
bin/kernel：     文件格式 elf32-i386


Disassembly of section .text:

c0100000 <kern_entry>:

.text
.globl kern_entry
kern_entry:
    # load pa of boot pgdir
    movl $REALLOC(__boot_pgdir), %eax
c0100000:	b8 00 a0 11 00       	mov    $0x11a000,%eax
    movl %eax, %cr3
c0100005:	0f 22 d8             	mov    %eax,%cr3

    # enable paging
    movl %cr0, %eax
c0100008:	0f 20 c0             	mov    %cr0,%eax
    orl $(CR0_PE | CR0_PG | CR0_AM | CR0_WP | CR0_NE | CR0_TS | CR0_EM | CR0_MP), %eax
c010000b:	0d 2f 00 05 80       	or     $0x8005002f,%eax
    andl $~(CR0_TS | CR0_EM), %eax
c0100010:	83 e0 f3             	and    $0xfffffff3,%eax
    movl %eax, %cr0
c0100013:	0f 22 c0             	mov    %eax,%cr0

    # update eip
    # now, eip = 0x1.....
    leal next, %eax
c0100016:	8d 05 1e 00 10 c0    	lea    0xc010001e,%eax
    # set eip = KERNBASE + 0x1.....
    jmp *%eax
c010001c:	ff e0                	jmp    *%eax

c010001e <next>:
next:

    # unmap va 0 ~ 4M, it's temporary mapping
    xorl %eax, %eax
c010001e:	31 c0                	xor    %eax,%eax
    movl %eax, __boot_pgdir
c0100020:	a3 00 a0 11 c0       	mov    %eax,0xc011a000

    # set ebp, esp
    movl $0x0, %ebp
c0100025:	bd 00 00 00 00       	mov    $0x0,%ebp
    # the kernel stack region is from bootstack -- bootstacktop,
    # the kernel stack size is KSTACKSIZE (8KB)defined in memlayout.h
    movl $bootstacktop, %esp
c010002a:	bc 00 90 11 c0       	mov    $0xc0119000,%esp
    # now kernel stack is ready , call the first C function
    call kern_init
c010002f:	e8 02 00 00 00       	call   c0100036 <kern_init>

c0100034 <spin>:

# should never get here
spin:
    jmp spin
c0100034:	eb fe                	jmp    c0100034 <spin>

c0100036 <kern_init>:
int kern_init(void) __attribute__((noreturn));
void grade_backtrace(void);
static void lab1_switch_test(void);

int
kern_init(void) {
c0100036:	55                   	push   %ebp
c0100037:	89 e5                	mov    %esp,%ebp
c0100039:	83 ec 28             	sub    $0x28,%esp
    extern char edata[], end[];
    memset(edata, 0, end - edata);
c010003c:	b8 4c cf 11 c0       	mov    $0xc011cf4c,%eax
c0100041:	2d 00 c0 11 c0       	sub    $0xc011c000,%eax
c0100046:	89 44 24 08          	mov    %eax,0x8(%esp)
c010004a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0100051:	00 
c0100052:	c7 04 24 00 c0 11 c0 	movl   $0xc011c000,(%esp)
c0100059:	e8 4b 5e 00 00       	call   c0105ea9 <memset>

    cons_init();                // init the console
c010005e:	e8 fd 15 00 00       	call   c0101660 <cons_init>

    const char *message = "(THU.CST) os is loading ...";
c0100063:	c7 45 f4 40 60 10 c0 	movl   $0xc0106040,-0xc(%ebp)
    cprintf("%s\n\n", message);
c010006a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010006d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100071:	c7 04 24 5c 60 10 c0 	movl   $0xc010605c,(%esp)
c0100078:	e8 e9 02 00 00       	call   c0100366 <cprintf>

    print_kerninfo();
c010007d:	e8 07 08 00 00       	call   c0100889 <print_kerninfo>

    grade_backtrace();
c0100082:	e8 95 00 00 00       	call   c010011c <grade_backtrace>

    pmm_init();                 // init physical memory management
c0100087:	e8 27 45 00 00       	call   c01045b3 <pmm_init>

    pic_init();                 // init interrupt controller
c010008c:	e8 50 17 00 00       	call   c01017e1 <pic_init>
    idt_init();                 // init interrupt descriptor table
c0100091:	e8 b4 18 00 00       	call   c010194a <idt_init>

    clock_init();               // init clock interrupt
c0100096:	e8 24 0d 00 00       	call   c0100dbf <clock_init>
    intr_enable();              // enable irq interrupt
c010009b:	e8 9f 16 00 00       	call   c010173f <intr_enable>

    //LAB1: CAHLLENGE 1 If you try to do it, uncomment lab1_switch_test()
    // user/kernel mode switch test
    lab1_switch_test();
c01000a0:	e8 76 01 00 00       	call   c010021b <lab1_switch_test>

    /* do nothing */
    while (1);
c01000a5:	eb fe                	jmp    c01000a5 <kern_init+0x6f>

c01000a7 <grade_backtrace2>:
}

void __attribute__((noinline))
grade_backtrace2(int arg0, int arg1, int arg2, int arg3) {
c01000a7:	55                   	push   %ebp
c01000a8:	89 e5                	mov    %esp,%ebp
c01000aa:	83 ec 18             	sub    $0x18,%esp
    mon_backtrace(0, NULL, NULL);
c01000ad:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01000b4:	00 
c01000b5:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c01000bc:	00 
c01000bd:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c01000c4:	e8 11 0c 00 00       	call   c0100cda <mon_backtrace>
}
c01000c9:	90                   	nop
c01000ca:	89 ec                	mov    %ebp,%esp
c01000cc:	5d                   	pop    %ebp
c01000cd:	c3                   	ret    

c01000ce <grade_backtrace1>:

void __attribute__((noinline))
grade_backtrace1(int arg0, int arg1) {
c01000ce:	55                   	push   %ebp
c01000cf:	89 e5                	mov    %esp,%ebp
c01000d1:	83 ec 18             	sub    $0x18,%esp
c01000d4:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    grade_backtrace2(arg0, (int)&arg0, arg1, (int)&arg1);
c01000d7:	8d 4d 0c             	lea    0xc(%ebp),%ecx
c01000da:	8b 55 0c             	mov    0xc(%ebp),%edx
c01000dd:	8d 5d 08             	lea    0x8(%ebp),%ebx
c01000e0:	8b 45 08             	mov    0x8(%ebp),%eax
c01000e3:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c01000e7:	89 54 24 08          	mov    %edx,0x8(%esp)
c01000eb:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c01000ef:	89 04 24             	mov    %eax,(%esp)
c01000f2:	e8 b0 ff ff ff       	call   c01000a7 <grade_backtrace2>
}
c01000f7:	90                   	nop
c01000f8:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c01000fb:	89 ec                	mov    %ebp,%esp
c01000fd:	5d                   	pop    %ebp
c01000fe:	c3                   	ret    

c01000ff <grade_backtrace0>:

void __attribute__((noinline))
grade_backtrace0(int arg0, int arg1, int arg2) {
c01000ff:	55                   	push   %ebp
c0100100:	89 e5                	mov    %esp,%ebp
c0100102:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace1(arg0, arg2);
c0100105:	8b 45 10             	mov    0x10(%ebp),%eax
c0100108:	89 44 24 04          	mov    %eax,0x4(%esp)
c010010c:	8b 45 08             	mov    0x8(%ebp),%eax
c010010f:	89 04 24             	mov    %eax,(%esp)
c0100112:	e8 b7 ff ff ff       	call   c01000ce <grade_backtrace1>
}
c0100117:	90                   	nop
c0100118:	89 ec                	mov    %ebp,%esp
c010011a:	5d                   	pop    %ebp
c010011b:	c3                   	ret    

c010011c <grade_backtrace>:

void
grade_backtrace(void) {
c010011c:	55                   	push   %ebp
c010011d:	89 e5                	mov    %esp,%ebp
c010011f:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace0(0, (int)kern_init, 0xffff0000);
c0100122:	b8 36 00 10 c0       	mov    $0xc0100036,%eax
c0100127:	c7 44 24 08 00 00 ff 	movl   $0xffff0000,0x8(%esp)
c010012e:	ff 
c010012f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100133:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c010013a:	e8 c0 ff ff ff       	call   c01000ff <grade_backtrace0>
}
c010013f:	90                   	nop
c0100140:	89 ec                	mov    %ebp,%esp
c0100142:	5d                   	pop    %ebp
c0100143:	c3                   	ret    

c0100144 <lab1_print_cur_status>:

static void
lab1_print_cur_status(void) {
c0100144:	55                   	push   %ebp
c0100145:	89 e5                	mov    %esp,%ebp
c0100147:	83 ec 28             	sub    $0x28,%esp
    static int round = 0;
    uint16_t reg1, reg2, reg3, reg4;
    asm volatile (
c010014a:	8c 4d f6             	mov    %cs,-0xa(%ebp)
c010014d:	8c 5d f4             	mov    %ds,-0xc(%ebp)
c0100150:	8c 45 f2             	mov    %es,-0xe(%ebp)
c0100153:	8c 55 f0             	mov    %ss,-0x10(%ebp)
            "mov %%cs, %0;"
            "mov %%ds, %1;"
            "mov %%es, %2;"
            "mov %%ss, %3;"
            : "=m"(reg1), "=m"(reg2), "=m"(reg3), "=m"(reg4));
    cprintf("%d: @ring %d\n", round, reg1 & 3);
c0100156:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c010015a:	83 e0 03             	and    $0x3,%eax
c010015d:	89 c2                	mov    %eax,%edx
c010015f:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c0100164:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100168:	89 44 24 04          	mov    %eax,0x4(%esp)
c010016c:	c7 04 24 61 60 10 c0 	movl   $0xc0106061,(%esp)
c0100173:	e8 ee 01 00 00       	call   c0100366 <cprintf>
    cprintf("%d:  cs = %x\n", round, reg1);
c0100178:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c010017c:	89 c2                	mov    %eax,%edx
c010017e:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c0100183:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100187:	89 44 24 04          	mov    %eax,0x4(%esp)
c010018b:	c7 04 24 6f 60 10 c0 	movl   $0xc010606f,(%esp)
c0100192:	e8 cf 01 00 00       	call   c0100366 <cprintf>
    cprintf("%d:  ds = %x\n", round, reg2);
c0100197:	0f b7 45 f4          	movzwl -0xc(%ebp),%eax
c010019b:	89 c2                	mov    %eax,%edx
c010019d:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c01001a2:	89 54 24 08          	mov    %edx,0x8(%esp)
c01001a6:	89 44 24 04          	mov    %eax,0x4(%esp)
c01001aa:	c7 04 24 7d 60 10 c0 	movl   $0xc010607d,(%esp)
c01001b1:	e8 b0 01 00 00       	call   c0100366 <cprintf>
    cprintf("%d:  es = %x\n", round, reg3);
c01001b6:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c01001ba:	89 c2                	mov    %eax,%edx
c01001bc:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c01001c1:	89 54 24 08          	mov    %edx,0x8(%esp)
c01001c5:	89 44 24 04          	mov    %eax,0x4(%esp)
c01001c9:	c7 04 24 8b 60 10 c0 	movl   $0xc010608b,(%esp)
c01001d0:	e8 91 01 00 00       	call   c0100366 <cprintf>
    cprintf("%d:  ss = %x\n", round, reg4);
c01001d5:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
c01001d9:	89 c2                	mov    %eax,%edx
c01001db:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c01001e0:	89 54 24 08          	mov    %edx,0x8(%esp)
c01001e4:	89 44 24 04          	mov    %eax,0x4(%esp)
c01001e8:	c7 04 24 99 60 10 c0 	movl   $0xc0106099,(%esp)
c01001ef:	e8 72 01 00 00       	call   c0100366 <cprintf>
    round ++;
c01001f4:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c01001f9:	40                   	inc    %eax
c01001fa:	a3 00 c0 11 c0       	mov    %eax,0xc011c000
}
c01001ff:	90                   	nop
c0100200:	89 ec                	mov    %ebp,%esp
c0100202:	5d                   	pop    %ebp
c0100203:	c3                   	ret    

c0100204 <lab1_switch_to_user>:

static void
lab1_switch_to_user(void) {
c0100204:	55                   	push   %ebp
c0100205:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 : TODO
    asm volatile (
c0100207:	83 ec 08             	sub    $0x8,%esp
c010020a:	cd 78                	int    $0x78
c010020c:	89 ec                	mov    %ebp,%esp
	    "int %0 \n"
	    "movl %%ebp, %%esp"
	    : 
	    : "i"(T_SWITCH_TOU)
	);
}
c010020e:	90                   	nop
c010020f:	5d                   	pop    %ebp
c0100210:	c3                   	ret    

c0100211 <lab1_switch_to_kernel>:

static void
lab1_switch_to_kernel(void) {
c0100211:	55                   	push   %ebp
c0100212:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 :  TODO
    asm volatile (
c0100214:	cd 79                	int    $0x79
c0100216:	89 ec                	mov    %ebp,%esp
	    "int %0 \n"
	    "movl %%ebp, %%esp \n"
	    : 
	    : "i"(T_SWITCH_TOK)
	);
}
c0100218:	90                   	nop
c0100219:	5d                   	pop    %ebp
c010021a:	c3                   	ret    

c010021b <lab1_switch_test>:

static void
lab1_switch_test(void) {
c010021b:	55                   	push   %ebp
c010021c:	89 e5                	mov    %esp,%ebp
c010021e:	83 ec 18             	sub    $0x18,%esp
    lab1_print_cur_status();
c0100221:	e8 1e ff ff ff       	call   c0100144 <lab1_print_cur_status>
    cprintf("+++ switch to  user  mode +++\n");
c0100226:	c7 04 24 a8 60 10 c0 	movl   $0xc01060a8,(%esp)
c010022d:	e8 34 01 00 00       	call   c0100366 <cprintf>
    lab1_switch_to_user();
c0100232:	e8 cd ff ff ff       	call   c0100204 <lab1_switch_to_user>
    lab1_print_cur_status();
c0100237:	e8 08 ff ff ff       	call   c0100144 <lab1_print_cur_status>
    cprintf("+++ switch to kernel mode +++\n");
c010023c:	c7 04 24 c8 60 10 c0 	movl   $0xc01060c8,(%esp)
c0100243:	e8 1e 01 00 00       	call   c0100366 <cprintf>
    lab1_switch_to_kernel();
c0100248:	e8 c4 ff ff ff       	call   c0100211 <lab1_switch_to_kernel>
    lab1_print_cur_status();
c010024d:	e8 f2 fe ff ff       	call   c0100144 <lab1_print_cur_status>
}
c0100252:	90                   	nop
c0100253:	89 ec                	mov    %ebp,%esp
c0100255:	5d                   	pop    %ebp
c0100256:	c3                   	ret    

c0100257 <readline>:
 * The readline() function returns the text of the line read. If some errors
 * are happened, NULL is returned. The return value is a global variable,
 * thus it should be copied before it is used.
 * */
char *
readline(const char *prompt) {
c0100257:	55                   	push   %ebp
c0100258:	89 e5                	mov    %esp,%ebp
c010025a:	83 ec 28             	sub    $0x28,%esp
    if (prompt != NULL) {
c010025d:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100261:	74 13                	je     c0100276 <readline+0x1f>
        cprintf("%s", prompt);
c0100263:	8b 45 08             	mov    0x8(%ebp),%eax
c0100266:	89 44 24 04          	mov    %eax,0x4(%esp)
c010026a:	c7 04 24 e7 60 10 c0 	movl   $0xc01060e7,(%esp)
c0100271:	e8 f0 00 00 00       	call   c0100366 <cprintf>
    }
    int i = 0, c;
c0100276:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        c = getchar();
c010027d:	e8 73 01 00 00       	call   c01003f5 <getchar>
c0100282:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (c < 0) {
c0100285:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100289:	79 07                	jns    c0100292 <readline+0x3b>
            return NULL;
c010028b:	b8 00 00 00 00       	mov    $0x0,%eax
c0100290:	eb 78                	jmp    c010030a <readline+0xb3>
        }
        else if (c >= ' ' && i < BUFSIZE - 1) {
c0100292:	83 7d f0 1f          	cmpl   $0x1f,-0x10(%ebp)
c0100296:	7e 28                	jle    c01002c0 <readline+0x69>
c0100298:	81 7d f4 fe 03 00 00 	cmpl   $0x3fe,-0xc(%ebp)
c010029f:	7f 1f                	jg     c01002c0 <readline+0x69>
            cputchar(c);
c01002a1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01002a4:	89 04 24             	mov    %eax,(%esp)
c01002a7:	e8 e2 00 00 00       	call   c010038e <cputchar>
            buf[i ++] = c;
c01002ac:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01002af:	8d 50 01             	lea    0x1(%eax),%edx
c01002b2:	89 55 f4             	mov    %edx,-0xc(%ebp)
c01002b5:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01002b8:	88 90 20 c0 11 c0    	mov    %dl,-0x3fee3fe0(%eax)
c01002be:	eb 45                	jmp    c0100305 <readline+0xae>
        }
        else if (c == '\b' && i > 0) {
c01002c0:	83 7d f0 08          	cmpl   $0x8,-0x10(%ebp)
c01002c4:	75 16                	jne    c01002dc <readline+0x85>
c01002c6:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01002ca:	7e 10                	jle    c01002dc <readline+0x85>
            cputchar(c);
c01002cc:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01002cf:	89 04 24             	mov    %eax,(%esp)
c01002d2:	e8 b7 00 00 00       	call   c010038e <cputchar>
            i --;
c01002d7:	ff 4d f4             	decl   -0xc(%ebp)
c01002da:	eb 29                	jmp    c0100305 <readline+0xae>
        }
        else if (c == '\n' || c == '\r') {
c01002dc:	83 7d f0 0a          	cmpl   $0xa,-0x10(%ebp)
c01002e0:	74 06                	je     c01002e8 <readline+0x91>
c01002e2:	83 7d f0 0d          	cmpl   $0xd,-0x10(%ebp)
c01002e6:	75 95                	jne    c010027d <readline+0x26>
            cputchar(c);
c01002e8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01002eb:	89 04 24             	mov    %eax,(%esp)
c01002ee:	e8 9b 00 00 00       	call   c010038e <cputchar>
            buf[i] = '\0';
c01002f3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01002f6:	05 20 c0 11 c0       	add    $0xc011c020,%eax
c01002fb:	c6 00 00             	movb   $0x0,(%eax)
            return buf;
c01002fe:	b8 20 c0 11 c0       	mov    $0xc011c020,%eax
c0100303:	eb 05                	jmp    c010030a <readline+0xb3>
        c = getchar();
c0100305:	e9 73 ff ff ff       	jmp    c010027d <readline+0x26>
        }
    }
}
c010030a:	89 ec                	mov    %ebp,%esp
c010030c:	5d                   	pop    %ebp
c010030d:	c3                   	ret    

c010030e <cputch>:
/* *
 * cputch - writes a single character @c to stdout, and it will
 * increace the value of counter pointed by @cnt.
 * */
static void
cputch(int c, int *cnt) {
c010030e:	55                   	push   %ebp
c010030f:	89 e5                	mov    %esp,%ebp
c0100311:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
c0100314:	8b 45 08             	mov    0x8(%ebp),%eax
c0100317:	89 04 24             	mov    %eax,(%esp)
c010031a:	e8 70 13 00 00       	call   c010168f <cons_putc>
    (*cnt) ++;
c010031f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100322:	8b 00                	mov    (%eax),%eax
c0100324:	8d 50 01             	lea    0x1(%eax),%edx
c0100327:	8b 45 0c             	mov    0xc(%ebp),%eax
c010032a:	89 10                	mov    %edx,(%eax)
}
c010032c:	90                   	nop
c010032d:	89 ec                	mov    %ebp,%esp
c010032f:	5d                   	pop    %ebp
c0100330:	c3                   	ret    

c0100331 <vcprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int
vcprintf(const char *fmt, va_list ap) {
c0100331:	55                   	push   %ebp
c0100332:	89 e5                	mov    %esp,%ebp
c0100334:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
c0100337:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    vprintfmt((void*)cputch, &cnt, fmt, ap);
c010033e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100341:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0100345:	8b 45 08             	mov    0x8(%ebp),%eax
c0100348:	89 44 24 08          	mov    %eax,0x8(%esp)
c010034c:	8d 45 f4             	lea    -0xc(%ebp),%eax
c010034f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100353:	c7 04 24 0e 03 10 c0 	movl   $0xc010030e,(%esp)
c010035a:	e8 75 53 00 00       	call   c01056d4 <vprintfmt>
    return cnt;
c010035f:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0100362:	89 ec                	mov    %ebp,%esp
c0100364:	5d                   	pop    %ebp
c0100365:	c3                   	ret    

c0100366 <cprintf>:
 *
 * The return value is the number of characters which would be
 * written to stdout.
 * */
int
cprintf(const char *fmt, ...) {
c0100366:	55                   	push   %ebp
c0100367:	89 e5                	mov    %esp,%ebp
c0100369:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
c010036c:	8d 45 0c             	lea    0xc(%ebp),%eax
c010036f:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vcprintf(fmt, ap);
c0100372:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100375:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100379:	8b 45 08             	mov    0x8(%ebp),%eax
c010037c:	89 04 24             	mov    %eax,(%esp)
c010037f:	e8 ad ff ff ff       	call   c0100331 <vcprintf>
c0100384:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
c0100387:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010038a:	89 ec                	mov    %ebp,%esp
c010038c:	5d                   	pop    %ebp
c010038d:	c3                   	ret    

c010038e <cputchar>:

/* cputchar - writes a single character to stdout */
void
cputchar(int c) {
c010038e:	55                   	push   %ebp
c010038f:	89 e5                	mov    %esp,%ebp
c0100391:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
c0100394:	8b 45 08             	mov    0x8(%ebp),%eax
c0100397:	89 04 24             	mov    %eax,(%esp)
c010039a:	e8 f0 12 00 00       	call   c010168f <cons_putc>
}
c010039f:	90                   	nop
c01003a0:	89 ec                	mov    %ebp,%esp
c01003a2:	5d                   	pop    %ebp
c01003a3:	c3                   	ret    

c01003a4 <cputs>:
/* *
 * cputs- writes the string pointed by @str to stdout and
 * appends a newline character.
 * */
int
cputs(const char *str) {
c01003a4:	55                   	push   %ebp
c01003a5:	89 e5                	mov    %esp,%ebp
c01003a7:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
c01003aa:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    char c;
    while ((c = *str ++) != '\0') {
c01003b1:	eb 13                	jmp    c01003c6 <cputs+0x22>
        cputch(c, &cnt);
c01003b3:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c01003b7:	8d 55 f0             	lea    -0x10(%ebp),%edx
c01003ba:	89 54 24 04          	mov    %edx,0x4(%esp)
c01003be:	89 04 24             	mov    %eax,(%esp)
c01003c1:	e8 48 ff ff ff       	call   c010030e <cputch>
    while ((c = *str ++) != '\0') {
c01003c6:	8b 45 08             	mov    0x8(%ebp),%eax
c01003c9:	8d 50 01             	lea    0x1(%eax),%edx
c01003cc:	89 55 08             	mov    %edx,0x8(%ebp)
c01003cf:	0f b6 00             	movzbl (%eax),%eax
c01003d2:	88 45 f7             	mov    %al,-0x9(%ebp)
c01003d5:	80 7d f7 00          	cmpb   $0x0,-0x9(%ebp)
c01003d9:	75 d8                	jne    c01003b3 <cputs+0xf>
    }
    cputch('\n', &cnt);
c01003db:	8d 45 f0             	lea    -0x10(%ebp),%eax
c01003de:	89 44 24 04          	mov    %eax,0x4(%esp)
c01003e2:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
c01003e9:	e8 20 ff ff ff       	call   c010030e <cputch>
    return cnt;
c01003ee:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c01003f1:	89 ec                	mov    %ebp,%esp
c01003f3:	5d                   	pop    %ebp
c01003f4:	c3                   	ret    

c01003f5 <getchar>:

/* getchar - reads a single non-zero character from stdin */
int
getchar(void) {
c01003f5:	55                   	push   %ebp
c01003f6:	89 e5                	mov    %esp,%ebp
c01003f8:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = cons_getc()) == 0)
c01003fb:	90                   	nop
c01003fc:	e8 cd 12 00 00       	call   c01016ce <cons_getc>
c0100401:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0100404:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100408:	74 f2                	je     c01003fc <getchar+0x7>
        /* do nothing */;
    return c;
c010040a:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010040d:	89 ec                	mov    %ebp,%esp
c010040f:	5d                   	pop    %ebp
c0100410:	c3                   	ret    

c0100411 <stab_binsearch>:
 *      stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
 * will exit setting left = 118, right = 554.
 * */
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
           int type, uintptr_t addr) {
c0100411:	55                   	push   %ebp
c0100412:	89 e5                	mov    %esp,%ebp
c0100414:	83 ec 20             	sub    $0x20,%esp
    int l = *region_left, r = *region_right, any_matches = 0;
c0100417:	8b 45 0c             	mov    0xc(%ebp),%eax
c010041a:	8b 00                	mov    (%eax),%eax
c010041c:	89 45 fc             	mov    %eax,-0x4(%ebp)
c010041f:	8b 45 10             	mov    0x10(%ebp),%eax
c0100422:	8b 00                	mov    (%eax),%eax
c0100424:	89 45 f8             	mov    %eax,-0x8(%ebp)
c0100427:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

    while (l <= r) {
c010042e:	e9 ca 00 00 00       	jmp    c01004fd <stab_binsearch+0xec>
        int true_m = (l + r) / 2, m = true_m;
c0100433:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0100436:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100439:	01 d0                	add    %edx,%eax
c010043b:	89 c2                	mov    %eax,%edx
c010043d:	c1 ea 1f             	shr    $0x1f,%edx
c0100440:	01 d0                	add    %edx,%eax
c0100442:	d1 f8                	sar    %eax
c0100444:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0100447:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010044a:	89 45 f0             	mov    %eax,-0x10(%ebp)

        // search for earliest stab with right type
        while (m >= l && stabs[m].n_type != type) {
c010044d:	eb 03                	jmp    c0100452 <stab_binsearch+0x41>
            m --;
c010044f:	ff 4d f0             	decl   -0x10(%ebp)
        while (m >= l && stabs[m].n_type != type) {
c0100452:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100455:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c0100458:	7c 1f                	jl     c0100479 <stab_binsearch+0x68>
c010045a:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010045d:	89 d0                	mov    %edx,%eax
c010045f:	01 c0                	add    %eax,%eax
c0100461:	01 d0                	add    %edx,%eax
c0100463:	c1 e0 02             	shl    $0x2,%eax
c0100466:	89 c2                	mov    %eax,%edx
c0100468:	8b 45 08             	mov    0x8(%ebp),%eax
c010046b:	01 d0                	add    %edx,%eax
c010046d:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c0100471:	0f b6 c0             	movzbl %al,%eax
c0100474:	39 45 14             	cmp    %eax,0x14(%ebp)
c0100477:	75 d6                	jne    c010044f <stab_binsearch+0x3e>
        }
        if (m < l) {    // no match in [l, m]
c0100479:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010047c:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c010047f:	7d 09                	jge    c010048a <stab_binsearch+0x79>
            l = true_m + 1;
c0100481:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100484:	40                   	inc    %eax
c0100485:	89 45 fc             	mov    %eax,-0x4(%ebp)
            continue;
c0100488:	eb 73                	jmp    c01004fd <stab_binsearch+0xec>
        }

        // actual binary search
        any_matches = 1;
c010048a:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
        if (stabs[m].n_value < addr) {
c0100491:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0100494:	89 d0                	mov    %edx,%eax
c0100496:	01 c0                	add    %eax,%eax
c0100498:	01 d0                	add    %edx,%eax
c010049a:	c1 e0 02             	shl    $0x2,%eax
c010049d:	89 c2                	mov    %eax,%edx
c010049f:	8b 45 08             	mov    0x8(%ebp),%eax
c01004a2:	01 d0                	add    %edx,%eax
c01004a4:	8b 40 08             	mov    0x8(%eax),%eax
c01004a7:	39 45 18             	cmp    %eax,0x18(%ebp)
c01004aa:	76 11                	jbe    c01004bd <stab_binsearch+0xac>
            *region_left = m;
c01004ac:	8b 45 0c             	mov    0xc(%ebp),%eax
c01004af:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01004b2:	89 10                	mov    %edx,(%eax)
            l = true_m + 1;
c01004b4:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01004b7:	40                   	inc    %eax
c01004b8:	89 45 fc             	mov    %eax,-0x4(%ebp)
c01004bb:	eb 40                	jmp    c01004fd <stab_binsearch+0xec>
        } else if (stabs[m].n_value > addr) {
c01004bd:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01004c0:	89 d0                	mov    %edx,%eax
c01004c2:	01 c0                	add    %eax,%eax
c01004c4:	01 d0                	add    %edx,%eax
c01004c6:	c1 e0 02             	shl    $0x2,%eax
c01004c9:	89 c2                	mov    %eax,%edx
c01004cb:	8b 45 08             	mov    0x8(%ebp),%eax
c01004ce:	01 d0                	add    %edx,%eax
c01004d0:	8b 40 08             	mov    0x8(%eax),%eax
c01004d3:	39 45 18             	cmp    %eax,0x18(%ebp)
c01004d6:	73 14                	jae    c01004ec <stab_binsearch+0xdb>
            *region_right = m - 1;
c01004d8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01004db:	8d 50 ff             	lea    -0x1(%eax),%edx
c01004de:	8b 45 10             	mov    0x10(%ebp),%eax
c01004e1:	89 10                	mov    %edx,(%eax)
            r = m - 1;
c01004e3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01004e6:	48                   	dec    %eax
c01004e7:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01004ea:	eb 11                	jmp    c01004fd <stab_binsearch+0xec>
        } else {
            // exact match for 'addr', but continue loop to find
            // *region_right
            *region_left = m;
c01004ec:	8b 45 0c             	mov    0xc(%ebp),%eax
c01004ef:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01004f2:	89 10                	mov    %edx,(%eax)
            l = m;
c01004f4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01004f7:	89 45 fc             	mov    %eax,-0x4(%ebp)
            addr ++;
c01004fa:	ff 45 18             	incl   0x18(%ebp)
    while (l <= r) {
c01004fd:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100500:	3b 45 f8             	cmp    -0x8(%ebp),%eax
c0100503:	0f 8e 2a ff ff ff    	jle    c0100433 <stab_binsearch+0x22>
        }
    }

    if (!any_matches) {
c0100509:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010050d:	75 0f                	jne    c010051e <stab_binsearch+0x10d>
        *region_right = *region_left - 1;
c010050f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100512:	8b 00                	mov    (%eax),%eax
c0100514:	8d 50 ff             	lea    -0x1(%eax),%edx
c0100517:	8b 45 10             	mov    0x10(%ebp),%eax
c010051a:	89 10                	mov    %edx,(%eax)
        l = *region_right;
        for (; l > *region_left && stabs[l].n_type != type; l --)
            /* do nothing */;
        *region_left = l;
    }
}
c010051c:	eb 3e                	jmp    c010055c <stab_binsearch+0x14b>
        l = *region_right;
c010051e:	8b 45 10             	mov    0x10(%ebp),%eax
c0100521:	8b 00                	mov    (%eax),%eax
c0100523:	89 45 fc             	mov    %eax,-0x4(%ebp)
        for (; l > *region_left && stabs[l].n_type != type; l --)
c0100526:	eb 03                	jmp    c010052b <stab_binsearch+0x11a>
c0100528:	ff 4d fc             	decl   -0x4(%ebp)
c010052b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010052e:	8b 00                	mov    (%eax),%eax
c0100530:	39 45 fc             	cmp    %eax,-0x4(%ebp)
c0100533:	7e 1f                	jle    c0100554 <stab_binsearch+0x143>
c0100535:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0100538:	89 d0                	mov    %edx,%eax
c010053a:	01 c0                	add    %eax,%eax
c010053c:	01 d0                	add    %edx,%eax
c010053e:	c1 e0 02             	shl    $0x2,%eax
c0100541:	89 c2                	mov    %eax,%edx
c0100543:	8b 45 08             	mov    0x8(%ebp),%eax
c0100546:	01 d0                	add    %edx,%eax
c0100548:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c010054c:	0f b6 c0             	movzbl %al,%eax
c010054f:	39 45 14             	cmp    %eax,0x14(%ebp)
c0100552:	75 d4                	jne    c0100528 <stab_binsearch+0x117>
        *region_left = l;
c0100554:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100557:	8b 55 fc             	mov    -0x4(%ebp),%edx
c010055a:	89 10                	mov    %edx,(%eax)
}
c010055c:	90                   	nop
c010055d:	89 ec                	mov    %ebp,%esp
c010055f:	5d                   	pop    %ebp
c0100560:	c3                   	ret    

c0100561 <debuginfo_eip>:
 * the specified instruction address, @addr.  Returns 0 if information
 * was found, and negative if not.  But even if it returns negative it
 * has stored some information into '*info'.
 * */
int
debuginfo_eip(uintptr_t addr, struct eipdebuginfo *info) {
c0100561:	55                   	push   %ebp
c0100562:	89 e5                	mov    %esp,%ebp
c0100564:	83 ec 58             	sub    $0x58,%esp
    const struct stab *stabs, *stab_end;
    const char *stabstr, *stabstr_end;

    info->eip_file = "<unknown>";
c0100567:	8b 45 0c             	mov    0xc(%ebp),%eax
c010056a:	c7 00 ec 60 10 c0    	movl   $0xc01060ec,(%eax)
    info->eip_line = 0;
c0100570:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100573:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    info->eip_fn_name = "<unknown>";
c010057a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010057d:	c7 40 08 ec 60 10 c0 	movl   $0xc01060ec,0x8(%eax)
    info->eip_fn_namelen = 9;
c0100584:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100587:	c7 40 0c 09 00 00 00 	movl   $0x9,0xc(%eax)
    info->eip_fn_addr = addr;
c010058e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100591:	8b 55 08             	mov    0x8(%ebp),%edx
c0100594:	89 50 10             	mov    %edx,0x10(%eax)
    info->eip_fn_narg = 0;
c0100597:	8b 45 0c             	mov    0xc(%ebp),%eax
c010059a:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)

    stabs = __STAB_BEGIN__;
c01005a1:	c7 45 f4 78 73 10 c0 	movl   $0xc0107378,-0xc(%ebp)
    stab_end = __STAB_END__;
c01005a8:	c7 45 f0 a8 2a 11 c0 	movl   $0xc0112aa8,-0x10(%ebp)
    stabstr = __STABSTR_BEGIN__;
c01005af:	c7 45 ec a9 2a 11 c0 	movl   $0xc0112aa9,-0x14(%ebp)
    stabstr_end = __STABSTR_END__;
c01005b6:	c7 45 e8 59 60 11 c0 	movl   $0xc0116059,-0x18(%ebp)

    // String table validity checks
    if (stabstr_end <= stabstr || stabstr_end[-1] != 0) {
c01005bd:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01005c0:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c01005c3:	76 0b                	jbe    c01005d0 <debuginfo_eip+0x6f>
c01005c5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01005c8:	48                   	dec    %eax
c01005c9:	0f b6 00             	movzbl (%eax),%eax
c01005cc:	84 c0                	test   %al,%al
c01005ce:	74 0a                	je     c01005da <debuginfo_eip+0x79>
        return -1;
c01005d0:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01005d5:	e9 ab 02 00 00       	jmp    c0100885 <debuginfo_eip+0x324>
    // 'eip'.  First, we find the basic source file containing 'eip'.
    // Then, we look in that source file for the function.  Then we look
    // for the line number.

    // Search the entire set of stabs for the source file (type N_SO).
    int lfile = 0, rfile = (stab_end - stabs) - 1;
c01005da:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
c01005e1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01005e4:	2b 45 f4             	sub    -0xc(%ebp),%eax
c01005e7:	c1 f8 02             	sar    $0x2,%eax
c01005ea:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
c01005f0:	48                   	dec    %eax
c01005f1:	89 45 e0             	mov    %eax,-0x20(%ebp)
    stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
c01005f4:	8b 45 08             	mov    0x8(%ebp),%eax
c01005f7:	89 44 24 10          	mov    %eax,0x10(%esp)
c01005fb:	c7 44 24 0c 64 00 00 	movl   $0x64,0xc(%esp)
c0100602:	00 
c0100603:	8d 45 e0             	lea    -0x20(%ebp),%eax
c0100606:	89 44 24 08          	mov    %eax,0x8(%esp)
c010060a:	8d 45 e4             	lea    -0x1c(%ebp),%eax
c010060d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100611:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100614:	89 04 24             	mov    %eax,(%esp)
c0100617:	e8 f5 fd ff ff       	call   c0100411 <stab_binsearch>
    if (lfile == 0)
c010061c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010061f:	85 c0                	test   %eax,%eax
c0100621:	75 0a                	jne    c010062d <debuginfo_eip+0xcc>
        return -1;
c0100623:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0100628:	e9 58 02 00 00       	jmp    c0100885 <debuginfo_eip+0x324>

    // Search within that file's stabs for the function definition
    // (N_FUN).
    int lfun = lfile, rfun = rfile;
c010062d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100630:	89 45 dc             	mov    %eax,-0x24(%ebp)
c0100633:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0100636:	89 45 d8             	mov    %eax,-0x28(%ebp)
    int lline, rline;
    stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
c0100639:	8b 45 08             	mov    0x8(%ebp),%eax
c010063c:	89 44 24 10          	mov    %eax,0x10(%esp)
c0100640:	c7 44 24 0c 24 00 00 	movl   $0x24,0xc(%esp)
c0100647:	00 
c0100648:	8d 45 d8             	lea    -0x28(%ebp),%eax
c010064b:	89 44 24 08          	mov    %eax,0x8(%esp)
c010064f:	8d 45 dc             	lea    -0x24(%ebp),%eax
c0100652:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100656:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100659:	89 04 24             	mov    %eax,(%esp)
c010065c:	e8 b0 fd ff ff       	call   c0100411 <stab_binsearch>

    if (lfun <= rfun) {
c0100661:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0100664:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100667:	39 c2                	cmp    %eax,%edx
c0100669:	7f 78                	jg     c01006e3 <debuginfo_eip+0x182>
        // stabs[lfun] points to the function name
        // in the string table, but check bounds just in case.
        if (stabs[lfun].n_strx < stabstr_end - stabstr) {
c010066b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010066e:	89 c2                	mov    %eax,%edx
c0100670:	89 d0                	mov    %edx,%eax
c0100672:	01 c0                	add    %eax,%eax
c0100674:	01 d0                	add    %edx,%eax
c0100676:	c1 e0 02             	shl    $0x2,%eax
c0100679:	89 c2                	mov    %eax,%edx
c010067b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010067e:	01 d0                	add    %edx,%eax
c0100680:	8b 10                	mov    (%eax),%edx
c0100682:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100685:	2b 45 ec             	sub    -0x14(%ebp),%eax
c0100688:	39 c2                	cmp    %eax,%edx
c010068a:	73 22                	jae    c01006ae <debuginfo_eip+0x14d>
            info->eip_fn_name = stabstr + stabs[lfun].n_strx;
c010068c:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010068f:	89 c2                	mov    %eax,%edx
c0100691:	89 d0                	mov    %edx,%eax
c0100693:	01 c0                	add    %eax,%eax
c0100695:	01 d0                	add    %edx,%eax
c0100697:	c1 e0 02             	shl    $0x2,%eax
c010069a:	89 c2                	mov    %eax,%edx
c010069c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010069f:	01 d0                	add    %edx,%eax
c01006a1:	8b 10                	mov    (%eax),%edx
c01006a3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01006a6:	01 c2                	add    %eax,%edx
c01006a8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006ab:	89 50 08             	mov    %edx,0x8(%eax)
        }
        info->eip_fn_addr = stabs[lfun].n_value;
c01006ae:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01006b1:	89 c2                	mov    %eax,%edx
c01006b3:	89 d0                	mov    %edx,%eax
c01006b5:	01 c0                	add    %eax,%eax
c01006b7:	01 d0                	add    %edx,%eax
c01006b9:	c1 e0 02             	shl    $0x2,%eax
c01006bc:	89 c2                	mov    %eax,%edx
c01006be:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01006c1:	01 d0                	add    %edx,%eax
c01006c3:	8b 50 08             	mov    0x8(%eax),%edx
c01006c6:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006c9:	89 50 10             	mov    %edx,0x10(%eax)
        addr -= info->eip_fn_addr;
c01006cc:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006cf:	8b 40 10             	mov    0x10(%eax),%eax
c01006d2:	29 45 08             	sub    %eax,0x8(%ebp)
        // Search within the function definition for the line number.
        lline = lfun;
c01006d5:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01006d8:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfun;
c01006db:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01006de:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01006e1:	eb 15                	jmp    c01006f8 <debuginfo_eip+0x197>
    } else {
        // Couldn't find function stab!  Maybe we're in an assembly
        // file.  Search the whole file for the line number.
        info->eip_fn_addr = addr;
c01006e3:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006e6:	8b 55 08             	mov    0x8(%ebp),%edx
c01006e9:	89 50 10             	mov    %edx,0x10(%eax)
        lline = lfile;
c01006ec:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01006ef:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfile;
c01006f2:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01006f5:	89 45 d0             	mov    %eax,-0x30(%ebp)
    }
    info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
c01006f8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006fb:	8b 40 08             	mov    0x8(%eax),%eax
c01006fe:	c7 44 24 04 3a 00 00 	movl   $0x3a,0x4(%esp)
c0100705:	00 
c0100706:	89 04 24             	mov    %eax,(%esp)
c0100709:	e8 13 56 00 00       	call   c0105d21 <strfind>
c010070e:	8b 55 0c             	mov    0xc(%ebp),%edx
c0100711:	8b 4a 08             	mov    0x8(%edx),%ecx
c0100714:	29 c8                	sub    %ecx,%eax
c0100716:	89 c2                	mov    %eax,%edx
c0100718:	8b 45 0c             	mov    0xc(%ebp),%eax
c010071b:	89 50 0c             	mov    %edx,0xc(%eax)

    // Search within [lline, rline] for the line number stab.
    // If found, set info->eip_line to the right line number.
    // If not found, return -1.
    stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
c010071e:	8b 45 08             	mov    0x8(%ebp),%eax
c0100721:	89 44 24 10          	mov    %eax,0x10(%esp)
c0100725:	c7 44 24 0c 44 00 00 	movl   $0x44,0xc(%esp)
c010072c:	00 
c010072d:	8d 45 d0             	lea    -0x30(%ebp),%eax
c0100730:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100734:	8d 45 d4             	lea    -0x2c(%ebp),%eax
c0100737:	89 44 24 04          	mov    %eax,0x4(%esp)
c010073b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010073e:	89 04 24             	mov    %eax,(%esp)
c0100741:	e8 cb fc ff ff       	call   c0100411 <stab_binsearch>
    if (lline <= rline) {
c0100746:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0100749:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010074c:	39 c2                	cmp    %eax,%edx
c010074e:	7f 23                	jg     c0100773 <debuginfo_eip+0x212>
        info->eip_line = stabs[rline].n_desc;
c0100750:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0100753:	89 c2                	mov    %eax,%edx
c0100755:	89 d0                	mov    %edx,%eax
c0100757:	01 c0                	add    %eax,%eax
c0100759:	01 d0                	add    %edx,%eax
c010075b:	c1 e0 02             	shl    $0x2,%eax
c010075e:	89 c2                	mov    %eax,%edx
c0100760:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100763:	01 d0                	add    %edx,%eax
c0100765:	0f b7 40 06          	movzwl 0x6(%eax),%eax
c0100769:	89 c2                	mov    %eax,%edx
c010076b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010076e:	89 50 04             	mov    %edx,0x4(%eax)

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
c0100771:	eb 11                	jmp    c0100784 <debuginfo_eip+0x223>
        return -1;
c0100773:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0100778:	e9 08 01 00 00       	jmp    c0100885 <debuginfo_eip+0x324>
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
        lline --;
c010077d:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100780:	48                   	dec    %eax
c0100781:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    while (lline >= lfile
c0100784:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0100787:	8b 45 e4             	mov    -0x1c(%ebp),%eax
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
c010078a:	39 c2                	cmp    %eax,%edx
c010078c:	7c 56                	jl     c01007e4 <debuginfo_eip+0x283>
           && stabs[lline].n_type != N_SOL
c010078e:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100791:	89 c2                	mov    %eax,%edx
c0100793:	89 d0                	mov    %edx,%eax
c0100795:	01 c0                	add    %eax,%eax
c0100797:	01 d0                	add    %edx,%eax
c0100799:	c1 e0 02             	shl    $0x2,%eax
c010079c:	89 c2                	mov    %eax,%edx
c010079e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007a1:	01 d0                	add    %edx,%eax
c01007a3:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c01007a7:	3c 84                	cmp    $0x84,%al
c01007a9:	74 39                	je     c01007e4 <debuginfo_eip+0x283>
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
c01007ab:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01007ae:	89 c2                	mov    %eax,%edx
c01007b0:	89 d0                	mov    %edx,%eax
c01007b2:	01 c0                	add    %eax,%eax
c01007b4:	01 d0                	add    %edx,%eax
c01007b6:	c1 e0 02             	shl    $0x2,%eax
c01007b9:	89 c2                	mov    %eax,%edx
c01007bb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007be:	01 d0                	add    %edx,%eax
c01007c0:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c01007c4:	3c 64                	cmp    $0x64,%al
c01007c6:	75 b5                	jne    c010077d <debuginfo_eip+0x21c>
c01007c8:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01007cb:	89 c2                	mov    %eax,%edx
c01007cd:	89 d0                	mov    %edx,%eax
c01007cf:	01 c0                	add    %eax,%eax
c01007d1:	01 d0                	add    %edx,%eax
c01007d3:	c1 e0 02             	shl    $0x2,%eax
c01007d6:	89 c2                	mov    %eax,%edx
c01007d8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007db:	01 d0                	add    %edx,%eax
c01007dd:	8b 40 08             	mov    0x8(%eax),%eax
c01007e0:	85 c0                	test   %eax,%eax
c01007e2:	74 99                	je     c010077d <debuginfo_eip+0x21c>
    }
    if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr) {
c01007e4:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01007e7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01007ea:	39 c2                	cmp    %eax,%edx
c01007ec:	7c 42                	jl     c0100830 <debuginfo_eip+0x2cf>
c01007ee:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01007f1:	89 c2                	mov    %eax,%edx
c01007f3:	89 d0                	mov    %edx,%eax
c01007f5:	01 c0                	add    %eax,%eax
c01007f7:	01 d0                	add    %edx,%eax
c01007f9:	c1 e0 02             	shl    $0x2,%eax
c01007fc:	89 c2                	mov    %eax,%edx
c01007fe:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100801:	01 d0                	add    %edx,%eax
c0100803:	8b 10                	mov    (%eax),%edx
c0100805:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100808:	2b 45 ec             	sub    -0x14(%ebp),%eax
c010080b:	39 c2                	cmp    %eax,%edx
c010080d:	73 21                	jae    c0100830 <debuginfo_eip+0x2cf>
        info->eip_file = stabstr + stabs[lline].n_strx;
c010080f:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100812:	89 c2                	mov    %eax,%edx
c0100814:	89 d0                	mov    %edx,%eax
c0100816:	01 c0                	add    %eax,%eax
c0100818:	01 d0                	add    %edx,%eax
c010081a:	c1 e0 02             	shl    $0x2,%eax
c010081d:	89 c2                	mov    %eax,%edx
c010081f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100822:	01 d0                	add    %edx,%eax
c0100824:	8b 10                	mov    (%eax),%edx
c0100826:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100829:	01 c2                	add    %eax,%edx
c010082b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010082e:	89 10                	mov    %edx,(%eax)
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
c0100830:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0100833:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100836:	39 c2                	cmp    %eax,%edx
c0100838:	7d 46                	jge    c0100880 <debuginfo_eip+0x31f>
        for (lline = lfun + 1;
c010083a:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010083d:	40                   	inc    %eax
c010083e:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c0100841:	eb 16                	jmp    c0100859 <debuginfo_eip+0x2f8>
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
            info->eip_fn_narg ++;
c0100843:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100846:	8b 40 14             	mov    0x14(%eax),%eax
c0100849:	8d 50 01             	lea    0x1(%eax),%edx
c010084c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010084f:	89 50 14             	mov    %edx,0x14(%eax)
             lline ++) {
c0100852:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100855:	40                   	inc    %eax
c0100856:	89 45 d4             	mov    %eax,-0x2c(%ebp)
             lline < rfun && stabs[lline].n_type == N_PSYM;
c0100859:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010085c:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010085f:	39 c2                	cmp    %eax,%edx
c0100861:	7d 1d                	jge    c0100880 <debuginfo_eip+0x31f>
c0100863:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100866:	89 c2                	mov    %eax,%edx
c0100868:	89 d0                	mov    %edx,%eax
c010086a:	01 c0                	add    %eax,%eax
c010086c:	01 d0                	add    %edx,%eax
c010086e:	c1 e0 02             	shl    $0x2,%eax
c0100871:	89 c2                	mov    %eax,%edx
c0100873:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100876:	01 d0                	add    %edx,%eax
c0100878:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c010087c:	3c a0                	cmp    $0xa0,%al
c010087e:	74 c3                	je     c0100843 <debuginfo_eip+0x2e2>
        }
    }
    return 0;
c0100880:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100885:	89 ec                	mov    %ebp,%esp
c0100887:	5d                   	pop    %ebp
c0100888:	c3                   	ret    

c0100889 <print_kerninfo>:
 * print_kerninfo - print the information about kernel, including the location
 * of kernel entry, the start addresses of data and text segements, the start
 * address of free memory and how many memory that kernel has used.
 * */
void
print_kerninfo(void) {
c0100889:	55                   	push   %ebp
c010088a:	89 e5                	mov    %esp,%ebp
c010088c:	83 ec 18             	sub    $0x18,%esp
    extern char etext[], edata[], end[], kern_init[];
    cprintf("Special kernel symbols:\n");
c010088f:	c7 04 24 f6 60 10 c0 	movl   $0xc01060f6,(%esp)
c0100896:	e8 cb fa ff ff       	call   c0100366 <cprintf>
    cprintf("  entry  0x%08x (phys)\n", kern_init);
c010089b:	c7 44 24 04 36 00 10 	movl   $0xc0100036,0x4(%esp)
c01008a2:	c0 
c01008a3:	c7 04 24 0f 61 10 c0 	movl   $0xc010610f,(%esp)
c01008aa:	e8 b7 fa ff ff       	call   c0100366 <cprintf>
    cprintf("  etext  0x%08x (phys)\n", etext);
c01008af:	c7 44 24 04 35 60 10 	movl   $0xc0106035,0x4(%esp)
c01008b6:	c0 
c01008b7:	c7 04 24 27 61 10 c0 	movl   $0xc0106127,(%esp)
c01008be:	e8 a3 fa ff ff       	call   c0100366 <cprintf>
    cprintf("  edata  0x%08x (phys)\n", edata);
c01008c3:	c7 44 24 04 00 c0 11 	movl   $0xc011c000,0x4(%esp)
c01008ca:	c0 
c01008cb:	c7 04 24 3f 61 10 c0 	movl   $0xc010613f,(%esp)
c01008d2:	e8 8f fa ff ff       	call   c0100366 <cprintf>
    cprintf("  end    0x%08x (phys)\n", end);
c01008d7:	c7 44 24 04 4c cf 11 	movl   $0xc011cf4c,0x4(%esp)
c01008de:	c0 
c01008df:	c7 04 24 57 61 10 c0 	movl   $0xc0106157,(%esp)
c01008e6:	e8 7b fa ff ff       	call   c0100366 <cprintf>
    cprintf("Kernel executable memory footprint: %dKB\n", (end - kern_init + 1023)/1024);
c01008eb:	b8 4c cf 11 c0       	mov    $0xc011cf4c,%eax
c01008f0:	2d 36 00 10 c0       	sub    $0xc0100036,%eax
c01008f5:	05 ff 03 00 00       	add    $0x3ff,%eax
c01008fa:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
c0100900:	85 c0                	test   %eax,%eax
c0100902:	0f 48 c2             	cmovs  %edx,%eax
c0100905:	c1 f8 0a             	sar    $0xa,%eax
c0100908:	89 44 24 04          	mov    %eax,0x4(%esp)
c010090c:	c7 04 24 70 61 10 c0 	movl   $0xc0106170,(%esp)
c0100913:	e8 4e fa ff ff       	call   c0100366 <cprintf>
}
c0100918:	90                   	nop
c0100919:	89 ec                	mov    %ebp,%esp
c010091b:	5d                   	pop    %ebp
c010091c:	c3                   	ret    

c010091d <print_debuginfo>:
/* *
 * print_debuginfo - read and print the stat information for the address @eip,
 * and info.eip_fn_addr should be the first address of the related function.
 * */
void
print_debuginfo(uintptr_t eip) {
c010091d:	55                   	push   %ebp
c010091e:	89 e5                	mov    %esp,%ebp
c0100920:	81 ec 48 01 00 00    	sub    $0x148,%esp
    struct eipdebuginfo info;
    if (debuginfo_eip(eip, &info) != 0) {
c0100926:	8d 45 dc             	lea    -0x24(%ebp),%eax
c0100929:	89 44 24 04          	mov    %eax,0x4(%esp)
c010092d:	8b 45 08             	mov    0x8(%ebp),%eax
c0100930:	89 04 24             	mov    %eax,(%esp)
c0100933:	e8 29 fc ff ff       	call   c0100561 <debuginfo_eip>
c0100938:	85 c0                	test   %eax,%eax
c010093a:	74 15                	je     c0100951 <print_debuginfo+0x34>
        cprintf("    <unknow>: -- 0x%08x --\n", eip);
c010093c:	8b 45 08             	mov    0x8(%ebp),%eax
c010093f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100943:	c7 04 24 9a 61 10 c0 	movl   $0xc010619a,(%esp)
c010094a:	e8 17 fa ff ff       	call   c0100366 <cprintf>
        }
        fnname[j] = '\0';
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
                fnname, eip - info.eip_fn_addr);
    }
}
c010094f:	eb 6c                	jmp    c01009bd <print_debuginfo+0xa0>
        for (j = 0; j < info.eip_fn_namelen; j ++) {
c0100951:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100958:	eb 1b                	jmp    c0100975 <print_debuginfo+0x58>
            fnname[j] = info.eip_fn_name[j];
c010095a:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c010095d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100960:	01 d0                	add    %edx,%eax
c0100962:	0f b6 10             	movzbl (%eax),%edx
c0100965:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
c010096b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010096e:	01 c8                	add    %ecx,%eax
c0100970:	88 10                	mov    %dl,(%eax)
        for (j = 0; j < info.eip_fn_namelen; j ++) {
c0100972:	ff 45 f4             	incl   -0xc(%ebp)
c0100975:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100978:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c010097b:	7c dd                	jl     c010095a <print_debuginfo+0x3d>
        fnname[j] = '\0';
c010097d:	8d 95 dc fe ff ff    	lea    -0x124(%ebp),%edx
c0100983:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100986:	01 d0                	add    %edx,%eax
c0100988:	c6 00 00             	movb   $0x0,(%eax)
                fnname, eip - info.eip_fn_addr);
c010098b:	8b 55 ec             	mov    -0x14(%ebp),%edx
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
c010098e:	8b 45 08             	mov    0x8(%ebp),%eax
c0100991:	29 d0                	sub    %edx,%eax
c0100993:	89 c1                	mov    %eax,%ecx
c0100995:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0100998:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010099b:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c010099f:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
c01009a5:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c01009a9:	89 54 24 08          	mov    %edx,0x8(%esp)
c01009ad:	89 44 24 04          	mov    %eax,0x4(%esp)
c01009b1:	c7 04 24 b6 61 10 c0 	movl   $0xc01061b6,(%esp)
c01009b8:	e8 a9 f9 ff ff       	call   c0100366 <cprintf>
}
c01009bd:	90                   	nop
c01009be:	89 ec                	mov    %ebp,%esp
c01009c0:	5d                   	pop    %ebp
c01009c1:	c3                   	ret    

c01009c2 <read_eip>:

static __noinline uint32_t
read_eip(void) {
c01009c2:	55                   	push   %ebp
c01009c3:	89 e5                	mov    %esp,%ebp
c01009c5:	83 ec 10             	sub    $0x10,%esp
    uint32_t eip;
    asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
c01009c8:	8b 45 04             	mov    0x4(%ebp),%eax
c01009cb:	89 45 fc             	mov    %eax,-0x4(%ebp)
    return eip;
c01009ce:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c01009d1:	89 ec                	mov    %ebp,%esp
c01009d3:	5d                   	pop    %ebp
c01009d4:	c3                   	ret    

c01009d5 <print_stackframe>:
 *
 * Note that, the length of ebp-chain is limited. In boot/bootasm.S, before jumping
 * to the kernel entry, the value of ebp has been set to zero, that's the boundary.
 * */
void
print_stackframe(void) {
c01009d5:	55                   	push   %ebp
c01009d6:	89 e5                	mov    %esp,%ebp
c01009d8:	83 ec 48             	sub    $0x48,%esp
}

static inline uint32_t
read_ebp(void) {
    uint32_t ebp;
    asm volatile ("movl %%ebp, %0" : "=r" (ebp));
c01009db:	89 e8                	mov    %ebp,%eax
c01009dd:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return ebp;
c01009e0:	8b 45 e4             	mov    -0x1c(%ebp),%eax
      *    (3.4) call print_debuginfo(eip-1) to print the C calling function name and line number, etc.
      *    (3.5) popup a calling stackframe
      *           NOTICE: the calling funciton's return addr eip  = ss:[ebp+4]
      *                   the calling funciton's ebp = ss:[ebp]
      */
    uint32_t ebp = read_ebp(), eip = read_eip();
c01009e3:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01009e6:	e8 d7 ff ff ff       	call   c01009c2 <read_eip>
c01009eb:	89 45 f0             	mov    %eax,-0x10(%ebp)
    for (int i = 0; i < STACKFRAME_DEPTH; i++){
c01009ee:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c01009f5:	e9 8c 00 00 00       	jmp    c0100a86 <print_stackframe+0xb1>
        cprintf("ebp:0x%08x eip:0x%08x args: ", ebp, eip);
c01009fa:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01009fd:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100a01:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a04:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100a08:	c7 04 24 c8 61 10 c0 	movl   $0xc01061c8,(%esp)
c0100a0f:	e8 52 f9 ff ff       	call   c0100366 <cprintf>
        uint32_t arg[4];
        for(int j = 0; j < 4; j++){
c0100a14:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c0100a1b:	eb 35                	jmp    c0100a52 <print_stackframe+0x7d>
            arg[j] = *((uint32_t *)ebp + 2 + j);
c0100a1d:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100a20:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0100a27:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a2a:	01 d0                	add    %edx,%eax
c0100a2c:	83 c0 08             	add    $0x8,%eax
c0100a2f:	8b 10                	mov    (%eax),%edx
c0100a31:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100a34:	89 54 85 d4          	mov    %edx,-0x2c(%ebp,%eax,4)
            cprintf("0x%08x ", arg[j]);
c0100a38:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100a3b:	8b 44 85 d4          	mov    -0x2c(%ebp,%eax,4),%eax
c0100a3f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100a43:	c7 04 24 e5 61 10 c0 	movl   $0xc01061e5,(%esp)
c0100a4a:	e8 17 f9 ff ff       	call   c0100366 <cprintf>
        for(int j = 0; j < 4; j++){
c0100a4f:	ff 45 e8             	incl   -0x18(%ebp)
c0100a52:	83 7d e8 03          	cmpl   $0x3,-0x18(%ebp)
c0100a56:	7e c5                	jle    c0100a1d <print_stackframe+0x48>
        }
        cprintf("\n");
c0100a58:	c7 04 24 ed 61 10 c0 	movl   $0xc01061ed,(%esp)
c0100a5f:	e8 02 f9 ff ff       	call   c0100366 <cprintf>
        print_debuginfo(eip - 1);
c0100a64:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100a67:	48                   	dec    %eax
c0100a68:	89 04 24             	mov    %eax,(%esp)
c0100a6b:	e8 ad fe ff ff       	call   c010091d <print_debuginfo>
        eip = *((uint32_t *)ebp + 1);
c0100a70:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a73:	83 c0 04             	add    $0x4,%eax
c0100a76:	8b 00                	mov    (%eax),%eax
c0100a78:	89 45 f0             	mov    %eax,-0x10(%ebp)
        ebp = *((uint32_t *)ebp);
c0100a7b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a7e:	8b 00                	mov    (%eax),%eax
c0100a80:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for (int i = 0; i < STACKFRAME_DEPTH; i++){
c0100a83:	ff 45 ec             	incl   -0x14(%ebp)
c0100a86:	83 7d ec 13          	cmpl   $0x13,-0x14(%ebp)
c0100a8a:	0f 8e 6a ff ff ff    	jle    c01009fa <print_stackframe+0x25>
    }
}
c0100a90:	90                   	nop
c0100a91:	90                   	nop
c0100a92:	89 ec                	mov    %ebp,%esp
c0100a94:	5d                   	pop    %ebp
c0100a95:	c3                   	ret    

c0100a96 <parse>:
#define MAXARGS         16
#define WHITESPACE      " \t\n\r"

/* parse - parse the command buffer into whitespace-separated arguments */
static int
parse(char *buf, char **argv) {
c0100a96:	55                   	push   %ebp
c0100a97:	89 e5                	mov    %esp,%ebp
c0100a99:	83 ec 28             	sub    $0x28,%esp
    int argc = 0;
c0100a9c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100aa3:	eb 0c                	jmp    c0100ab1 <parse+0x1b>
            *buf ++ = '\0';
c0100aa5:	8b 45 08             	mov    0x8(%ebp),%eax
c0100aa8:	8d 50 01             	lea    0x1(%eax),%edx
c0100aab:	89 55 08             	mov    %edx,0x8(%ebp)
c0100aae:	c6 00 00             	movb   $0x0,(%eax)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100ab1:	8b 45 08             	mov    0x8(%ebp),%eax
c0100ab4:	0f b6 00             	movzbl (%eax),%eax
c0100ab7:	84 c0                	test   %al,%al
c0100ab9:	74 1d                	je     c0100ad8 <parse+0x42>
c0100abb:	8b 45 08             	mov    0x8(%ebp),%eax
c0100abe:	0f b6 00             	movzbl (%eax),%eax
c0100ac1:	0f be c0             	movsbl %al,%eax
c0100ac4:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100ac8:	c7 04 24 70 62 10 c0 	movl   $0xc0106270,(%esp)
c0100acf:	e8 19 52 00 00       	call   c0105ced <strchr>
c0100ad4:	85 c0                	test   %eax,%eax
c0100ad6:	75 cd                	jne    c0100aa5 <parse+0xf>
        }
        if (*buf == '\0') {
c0100ad8:	8b 45 08             	mov    0x8(%ebp),%eax
c0100adb:	0f b6 00             	movzbl (%eax),%eax
c0100ade:	84 c0                	test   %al,%al
c0100ae0:	74 65                	je     c0100b47 <parse+0xb1>
            break;
        }

        // save and scan past next arg
        if (argc == MAXARGS - 1) {
c0100ae2:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
c0100ae6:	75 14                	jne    c0100afc <parse+0x66>
            cprintf("Too many arguments (max %d).\n", MAXARGS);
c0100ae8:	c7 44 24 04 10 00 00 	movl   $0x10,0x4(%esp)
c0100aef:	00 
c0100af0:	c7 04 24 75 62 10 c0 	movl   $0xc0106275,(%esp)
c0100af7:	e8 6a f8 ff ff       	call   c0100366 <cprintf>
        }
        argv[argc ++] = buf;
c0100afc:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100aff:	8d 50 01             	lea    0x1(%eax),%edx
c0100b02:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0100b05:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0100b0c:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100b0f:	01 c2                	add    %eax,%edx
c0100b11:	8b 45 08             	mov    0x8(%ebp),%eax
c0100b14:	89 02                	mov    %eax,(%edx)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100b16:	eb 03                	jmp    c0100b1b <parse+0x85>
            buf ++;
c0100b18:	ff 45 08             	incl   0x8(%ebp)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100b1b:	8b 45 08             	mov    0x8(%ebp),%eax
c0100b1e:	0f b6 00             	movzbl (%eax),%eax
c0100b21:	84 c0                	test   %al,%al
c0100b23:	74 8c                	je     c0100ab1 <parse+0x1b>
c0100b25:	8b 45 08             	mov    0x8(%ebp),%eax
c0100b28:	0f b6 00             	movzbl (%eax),%eax
c0100b2b:	0f be c0             	movsbl %al,%eax
c0100b2e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100b32:	c7 04 24 70 62 10 c0 	movl   $0xc0106270,(%esp)
c0100b39:	e8 af 51 00 00       	call   c0105ced <strchr>
c0100b3e:	85 c0                	test   %eax,%eax
c0100b40:	74 d6                	je     c0100b18 <parse+0x82>
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100b42:	e9 6a ff ff ff       	jmp    c0100ab1 <parse+0x1b>
            break;
c0100b47:	90                   	nop
        }
    }
    return argc;
c0100b48:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0100b4b:	89 ec                	mov    %ebp,%esp
c0100b4d:	5d                   	pop    %ebp
c0100b4e:	c3                   	ret    

c0100b4f <runcmd>:
/* *
 * runcmd - parse the input string, split it into separated arguments
 * and then lookup and invoke some related commands/
 * */
static int
runcmd(char *buf, struct trapframe *tf) {
c0100b4f:	55                   	push   %ebp
c0100b50:	89 e5                	mov    %esp,%ebp
c0100b52:	83 ec 68             	sub    $0x68,%esp
c0100b55:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    char *argv[MAXARGS];
    int argc = parse(buf, argv);
c0100b58:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100b5b:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100b5f:	8b 45 08             	mov    0x8(%ebp),%eax
c0100b62:	89 04 24             	mov    %eax,(%esp)
c0100b65:	e8 2c ff ff ff       	call   c0100a96 <parse>
c0100b6a:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if (argc == 0) {
c0100b6d:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100b71:	75 0a                	jne    c0100b7d <runcmd+0x2e>
        return 0;
c0100b73:	b8 00 00 00 00       	mov    $0x0,%eax
c0100b78:	e9 83 00 00 00       	jmp    c0100c00 <runcmd+0xb1>
    }
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0100b7d:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100b84:	eb 5a                	jmp    c0100be0 <runcmd+0x91>
        if (strcmp(commands[i].name, argv[0]) == 0) {
c0100b86:	8b 55 b0             	mov    -0x50(%ebp),%edx
c0100b89:	8b 4d f4             	mov    -0xc(%ebp),%ecx
c0100b8c:	89 c8                	mov    %ecx,%eax
c0100b8e:	01 c0                	add    %eax,%eax
c0100b90:	01 c8                	add    %ecx,%eax
c0100b92:	c1 e0 02             	shl    $0x2,%eax
c0100b95:	05 00 90 11 c0       	add    $0xc0119000,%eax
c0100b9a:	8b 00                	mov    (%eax),%eax
c0100b9c:	89 54 24 04          	mov    %edx,0x4(%esp)
c0100ba0:	89 04 24             	mov    %eax,(%esp)
c0100ba3:	e8 a9 50 00 00       	call   c0105c51 <strcmp>
c0100ba8:	85 c0                	test   %eax,%eax
c0100baa:	75 31                	jne    c0100bdd <runcmd+0x8e>
            return commands[i].func(argc - 1, argv + 1, tf);
c0100bac:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100baf:	89 d0                	mov    %edx,%eax
c0100bb1:	01 c0                	add    %eax,%eax
c0100bb3:	01 d0                	add    %edx,%eax
c0100bb5:	c1 e0 02             	shl    $0x2,%eax
c0100bb8:	05 08 90 11 c0       	add    $0xc0119008,%eax
c0100bbd:	8b 10                	mov    (%eax),%edx
c0100bbf:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100bc2:	83 c0 04             	add    $0x4,%eax
c0100bc5:	8b 4d f0             	mov    -0x10(%ebp),%ecx
c0100bc8:	8d 59 ff             	lea    -0x1(%ecx),%ebx
c0100bcb:	8b 4d 0c             	mov    0xc(%ebp),%ecx
c0100bce:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0100bd2:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100bd6:	89 1c 24             	mov    %ebx,(%esp)
c0100bd9:	ff d2                	call   *%edx
c0100bdb:	eb 23                	jmp    c0100c00 <runcmd+0xb1>
    for (i = 0; i < NCOMMANDS; i ++) {
c0100bdd:	ff 45 f4             	incl   -0xc(%ebp)
c0100be0:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100be3:	83 f8 02             	cmp    $0x2,%eax
c0100be6:	76 9e                	jbe    c0100b86 <runcmd+0x37>
        }
    }
    cprintf("Unknown command '%s'\n", argv[0]);
c0100be8:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0100beb:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100bef:	c7 04 24 93 62 10 c0 	movl   $0xc0106293,(%esp)
c0100bf6:	e8 6b f7 ff ff       	call   c0100366 <cprintf>
    return 0;
c0100bfb:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100c00:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c0100c03:	89 ec                	mov    %ebp,%esp
c0100c05:	5d                   	pop    %ebp
c0100c06:	c3                   	ret    

c0100c07 <kmonitor>:

/***** Implementations of basic kernel monitor commands *****/

void
kmonitor(struct trapframe *tf) {
c0100c07:	55                   	push   %ebp
c0100c08:	89 e5                	mov    %esp,%ebp
c0100c0a:	83 ec 28             	sub    $0x28,%esp
    cprintf("Welcome to the kernel debug monitor!!\n");
c0100c0d:	c7 04 24 ac 62 10 c0 	movl   $0xc01062ac,(%esp)
c0100c14:	e8 4d f7 ff ff       	call   c0100366 <cprintf>
    cprintf("Type 'help' for a list of commands.\n");
c0100c19:	c7 04 24 d4 62 10 c0 	movl   $0xc01062d4,(%esp)
c0100c20:	e8 41 f7 ff ff       	call   c0100366 <cprintf>

    if (tf != NULL) {
c0100c25:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100c29:	74 0b                	je     c0100c36 <kmonitor+0x2f>
        print_trapframe(tf);
c0100c2b:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c2e:	89 04 24             	mov    %eax,(%esp)
c0100c31:	e8 cf 0e 00 00       	call   c0101b05 <print_trapframe>
    }

    char *buf;
    while (1) {
        if ((buf = readline("K> ")) != NULL) {
c0100c36:	c7 04 24 f9 62 10 c0 	movl   $0xc01062f9,(%esp)
c0100c3d:	e8 15 f6 ff ff       	call   c0100257 <readline>
c0100c42:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0100c45:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100c49:	74 eb                	je     c0100c36 <kmonitor+0x2f>
            if (runcmd(buf, tf) < 0) {
c0100c4b:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c4e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100c52:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100c55:	89 04 24             	mov    %eax,(%esp)
c0100c58:	e8 f2 fe ff ff       	call   c0100b4f <runcmd>
c0100c5d:	85 c0                	test   %eax,%eax
c0100c5f:	78 02                	js     c0100c63 <kmonitor+0x5c>
        if ((buf = readline("K> ")) != NULL) {
c0100c61:	eb d3                	jmp    c0100c36 <kmonitor+0x2f>
                break;
c0100c63:	90                   	nop
            }
        }
    }
}
c0100c64:	90                   	nop
c0100c65:	89 ec                	mov    %ebp,%esp
c0100c67:	5d                   	pop    %ebp
c0100c68:	c3                   	ret    

c0100c69 <mon_help>:

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
c0100c69:	55                   	push   %ebp
c0100c6a:	89 e5                	mov    %esp,%ebp
c0100c6c:	83 ec 28             	sub    $0x28,%esp
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0100c6f:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100c76:	eb 3d                	jmp    c0100cb5 <mon_help+0x4c>
        cprintf("%s - %s\n", commands[i].name, commands[i].desc);
c0100c78:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100c7b:	89 d0                	mov    %edx,%eax
c0100c7d:	01 c0                	add    %eax,%eax
c0100c7f:	01 d0                	add    %edx,%eax
c0100c81:	c1 e0 02             	shl    $0x2,%eax
c0100c84:	05 04 90 11 c0       	add    $0xc0119004,%eax
c0100c89:	8b 10                	mov    (%eax),%edx
c0100c8b:	8b 4d f4             	mov    -0xc(%ebp),%ecx
c0100c8e:	89 c8                	mov    %ecx,%eax
c0100c90:	01 c0                	add    %eax,%eax
c0100c92:	01 c8                	add    %ecx,%eax
c0100c94:	c1 e0 02             	shl    $0x2,%eax
c0100c97:	05 00 90 11 c0       	add    $0xc0119000,%eax
c0100c9c:	8b 00                	mov    (%eax),%eax
c0100c9e:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100ca2:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100ca6:	c7 04 24 fd 62 10 c0 	movl   $0xc01062fd,(%esp)
c0100cad:	e8 b4 f6 ff ff       	call   c0100366 <cprintf>
    for (i = 0; i < NCOMMANDS; i ++) {
c0100cb2:	ff 45 f4             	incl   -0xc(%ebp)
c0100cb5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100cb8:	83 f8 02             	cmp    $0x2,%eax
c0100cbb:	76 bb                	jbe    c0100c78 <mon_help+0xf>
    }
    return 0;
c0100cbd:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100cc2:	89 ec                	mov    %ebp,%esp
c0100cc4:	5d                   	pop    %ebp
c0100cc5:	c3                   	ret    

c0100cc6 <mon_kerninfo>:
/* *
 * mon_kerninfo - call print_kerninfo in kern/debug/kdebug.c to
 * print the memory occupancy in kernel.
 * */
int
mon_kerninfo(int argc, char **argv, struct trapframe *tf) {
c0100cc6:	55                   	push   %ebp
c0100cc7:	89 e5                	mov    %esp,%ebp
c0100cc9:	83 ec 08             	sub    $0x8,%esp
    print_kerninfo();
c0100ccc:	e8 b8 fb ff ff       	call   c0100889 <print_kerninfo>
    return 0;
c0100cd1:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100cd6:	89 ec                	mov    %ebp,%esp
c0100cd8:	5d                   	pop    %ebp
c0100cd9:	c3                   	ret    

c0100cda <mon_backtrace>:
/* *
 * mon_backtrace - call print_stackframe in kern/debug/kdebug.c to
 * print a backtrace of the stack.
 * */
int
mon_backtrace(int argc, char **argv, struct trapframe *tf) {
c0100cda:	55                   	push   %ebp
c0100cdb:	89 e5                	mov    %esp,%ebp
c0100cdd:	83 ec 08             	sub    $0x8,%esp
    print_stackframe();
c0100ce0:	e8 f0 fc ff ff       	call   c01009d5 <print_stackframe>
    return 0;
c0100ce5:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100cea:	89 ec                	mov    %ebp,%esp
c0100cec:	5d                   	pop    %ebp
c0100ced:	c3                   	ret    

c0100cee <__panic>:
/* *
 * __panic - __panic is called on unresolvable fatal errors. it prints
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
c0100cee:	55                   	push   %ebp
c0100cef:	89 e5                	mov    %esp,%ebp
c0100cf1:	83 ec 28             	sub    $0x28,%esp
    if (is_panic) {
c0100cf4:	a1 20 c4 11 c0       	mov    0xc011c420,%eax
c0100cf9:	85 c0                	test   %eax,%eax
c0100cfb:	75 5b                	jne    c0100d58 <__panic+0x6a>
        goto panic_dead;
    }
    is_panic = 1;
c0100cfd:	c7 05 20 c4 11 c0 01 	movl   $0x1,0xc011c420
c0100d04:	00 00 00 

    // print the 'message'
    va_list ap;
    va_start(ap, fmt);
c0100d07:	8d 45 14             	lea    0x14(%ebp),%eax
c0100d0a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel panic at %s:%d:\n    ", file, line);
c0100d0d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100d10:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100d14:	8b 45 08             	mov    0x8(%ebp),%eax
c0100d17:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100d1b:	c7 04 24 06 63 10 c0 	movl   $0xc0106306,(%esp)
c0100d22:	e8 3f f6 ff ff       	call   c0100366 <cprintf>
    vcprintf(fmt, ap);
c0100d27:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100d2a:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100d2e:	8b 45 10             	mov    0x10(%ebp),%eax
c0100d31:	89 04 24             	mov    %eax,(%esp)
c0100d34:	e8 f8 f5 ff ff       	call   c0100331 <vcprintf>
    cprintf("\n");
c0100d39:	c7 04 24 22 63 10 c0 	movl   $0xc0106322,(%esp)
c0100d40:	e8 21 f6 ff ff       	call   c0100366 <cprintf>
    
    cprintf("stack trackback:\n");
c0100d45:	c7 04 24 24 63 10 c0 	movl   $0xc0106324,(%esp)
c0100d4c:	e8 15 f6 ff ff       	call   c0100366 <cprintf>
    print_stackframe();
c0100d51:	e8 7f fc ff ff       	call   c01009d5 <print_stackframe>
c0100d56:	eb 01                	jmp    c0100d59 <__panic+0x6b>
        goto panic_dead;
c0100d58:	90                   	nop
    
    va_end(ap);

panic_dead:
    intr_disable();
c0100d59:	e8 e9 09 00 00       	call   c0101747 <intr_disable>
    while (1) {
        kmonitor(NULL);
c0100d5e:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c0100d65:	e8 9d fe ff ff       	call   c0100c07 <kmonitor>
c0100d6a:	eb f2                	jmp    c0100d5e <__panic+0x70>

c0100d6c <__warn>:
    }
}

/* __warn - like panic, but don't */
void
__warn(const char *file, int line, const char *fmt, ...) {
c0100d6c:	55                   	push   %ebp
c0100d6d:	89 e5                	mov    %esp,%ebp
c0100d6f:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    va_start(ap, fmt);
c0100d72:	8d 45 14             	lea    0x14(%ebp),%eax
c0100d75:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel warning at %s:%d:\n    ", file, line);
c0100d78:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100d7b:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100d7f:	8b 45 08             	mov    0x8(%ebp),%eax
c0100d82:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100d86:	c7 04 24 36 63 10 c0 	movl   $0xc0106336,(%esp)
c0100d8d:	e8 d4 f5 ff ff       	call   c0100366 <cprintf>
    vcprintf(fmt, ap);
c0100d92:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100d95:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100d99:	8b 45 10             	mov    0x10(%ebp),%eax
c0100d9c:	89 04 24             	mov    %eax,(%esp)
c0100d9f:	e8 8d f5 ff ff       	call   c0100331 <vcprintf>
    cprintf("\n");
c0100da4:	c7 04 24 22 63 10 c0 	movl   $0xc0106322,(%esp)
c0100dab:	e8 b6 f5 ff ff       	call   c0100366 <cprintf>
    va_end(ap);
}
c0100db0:	90                   	nop
c0100db1:	89 ec                	mov    %ebp,%esp
c0100db3:	5d                   	pop    %ebp
c0100db4:	c3                   	ret    

c0100db5 <is_kernel_panic>:

bool
is_kernel_panic(void) {
c0100db5:	55                   	push   %ebp
c0100db6:	89 e5                	mov    %esp,%ebp
    return is_panic;
c0100db8:	a1 20 c4 11 c0       	mov    0xc011c420,%eax
}
c0100dbd:	5d                   	pop    %ebp
c0100dbe:	c3                   	ret    

c0100dbf <clock_init>:
/* *
 * clock_init - initialize 8253 clock to interrupt 100 times per second,
 * and then enable IRQ_TIMER.
 * */
void
clock_init(void) {
c0100dbf:	55                   	push   %ebp
c0100dc0:	89 e5                	mov    %esp,%ebp
c0100dc2:	83 ec 28             	sub    $0x28,%esp
c0100dc5:	66 c7 45 ee 43 00    	movw   $0x43,-0x12(%ebp)
c0100dcb:	c6 45 ed 34          	movb   $0x34,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100dcf:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0100dd3:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0100dd7:	ee                   	out    %al,(%dx)
}
c0100dd8:	90                   	nop
c0100dd9:	66 c7 45 f2 40 00    	movw   $0x40,-0xe(%ebp)
c0100ddf:	c6 45 f1 9c          	movb   $0x9c,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100de3:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0100de7:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0100deb:	ee                   	out    %al,(%dx)
}
c0100dec:	90                   	nop
c0100ded:	66 c7 45 f6 40 00    	movw   $0x40,-0xa(%ebp)
c0100df3:	c6 45 f5 2e          	movb   $0x2e,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100df7:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0100dfb:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0100dff:	ee                   	out    %al,(%dx)
}
c0100e00:	90                   	nop
    outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
    outb(IO_TIMER1, TIMER_DIV(100) % 256);
    outb(IO_TIMER1, TIMER_DIV(100) / 256);

    // initialize time counter 'ticks' to zero
    ticks = 0;
c0100e01:	c7 05 24 c4 11 c0 00 	movl   $0x0,0xc011c424
c0100e08:	00 00 00 

    cprintf("++ setup timer interrupts\n");
c0100e0b:	c7 04 24 54 63 10 c0 	movl   $0xc0106354,(%esp)
c0100e12:	e8 4f f5 ff ff       	call   c0100366 <cprintf>
    pic_enable(IRQ_TIMER);
c0100e17:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c0100e1e:	e8 89 09 00 00       	call   c01017ac <pic_enable>
}
c0100e23:	90                   	nop
c0100e24:	89 ec                	mov    %ebp,%esp
c0100e26:	5d                   	pop    %ebp
c0100e27:	c3                   	ret    

c0100e28 <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
c0100e28:	55                   	push   %ebp
c0100e29:	89 e5                	mov    %esp,%ebp
c0100e2b:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0100e2e:	9c                   	pushf  
c0100e2f:	58                   	pop    %eax
c0100e30:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c0100e33:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c0100e36:	25 00 02 00 00       	and    $0x200,%eax
c0100e3b:	85 c0                	test   %eax,%eax
c0100e3d:	74 0c                	je     c0100e4b <__intr_save+0x23>
        intr_disable();
c0100e3f:	e8 03 09 00 00       	call   c0101747 <intr_disable>
        return 1;
c0100e44:	b8 01 00 00 00       	mov    $0x1,%eax
c0100e49:	eb 05                	jmp    c0100e50 <__intr_save+0x28>
    }
    return 0;
c0100e4b:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100e50:	89 ec                	mov    %ebp,%esp
c0100e52:	5d                   	pop    %ebp
c0100e53:	c3                   	ret    

c0100e54 <__intr_restore>:

static inline void
__intr_restore(bool flag) {
c0100e54:	55                   	push   %ebp
c0100e55:	89 e5                	mov    %esp,%ebp
c0100e57:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c0100e5a:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100e5e:	74 05                	je     c0100e65 <__intr_restore+0x11>
        intr_enable();
c0100e60:	e8 da 08 00 00       	call   c010173f <intr_enable>
    }
}
c0100e65:	90                   	nop
c0100e66:	89 ec                	mov    %ebp,%esp
c0100e68:	5d                   	pop    %ebp
c0100e69:	c3                   	ret    

c0100e6a <delay>:
#include <memlayout.h>
#include <sync.h>

/* stupid I/O delay routine necessitated by historical PC design flaws */
static void
delay(void) {
c0100e6a:	55                   	push   %ebp
c0100e6b:	89 e5                	mov    %esp,%ebp
c0100e6d:	83 ec 10             	sub    $0x10,%esp
c0100e70:	66 c7 45 f2 84 00    	movw   $0x84,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100e76:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0100e7a:	89 c2                	mov    %eax,%edx
c0100e7c:	ec                   	in     (%dx),%al
c0100e7d:	88 45 f1             	mov    %al,-0xf(%ebp)
c0100e80:	66 c7 45 f6 84 00    	movw   $0x84,-0xa(%ebp)
c0100e86:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100e8a:	89 c2                	mov    %eax,%edx
c0100e8c:	ec                   	in     (%dx),%al
c0100e8d:	88 45 f5             	mov    %al,-0xb(%ebp)
c0100e90:	66 c7 45 fa 84 00    	movw   $0x84,-0x6(%ebp)
c0100e96:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0100e9a:	89 c2                	mov    %eax,%edx
c0100e9c:	ec                   	in     (%dx),%al
c0100e9d:	88 45 f9             	mov    %al,-0x7(%ebp)
c0100ea0:	66 c7 45 fe 84 00    	movw   $0x84,-0x2(%ebp)
c0100ea6:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
c0100eaa:	89 c2                	mov    %eax,%edx
c0100eac:	ec                   	in     (%dx),%al
c0100ead:	88 45 fd             	mov    %al,-0x3(%ebp)
    inb(0x84);
    inb(0x84);
    inb(0x84);
    inb(0x84);
}
c0100eb0:	90                   	nop
c0100eb1:	89 ec                	mov    %ebp,%esp
c0100eb3:	5d                   	pop    %ebp
c0100eb4:	c3                   	ret    

c0100eb5 <cga_init>:
static uint16_t addr_6845;

/* TEXT-mode CGA/VGA display output */

static void
cga_init(void) {
c0100eb5:	55                   	push   %ebp
c0100eb6:	89 e5                	mov    %esp,%ebp
c0100eb8:	83 ec 20             	sub    $0x20,%esp
    volatile uint16_t *cp = (uint16_t *)(CGA_BUF + KERNBASE);
c0100ebb:	c7 45 fc 00 80 0b c0 	movl   $0xc00b8000,-0x4(%ebp)
    uint16_t was = *cp;
c0100ec2:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100ec5:	0f b7 00             	movzwl (%eax),%eax
c0100ec8:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
    *cp = (uint16_t) 0xA55A;
c0100ecc:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100ecf:	66 c7 00 5a a5       	movw   $0xa55a,(%eax)
    if (*cp != 0xA55A) {
c0100ed4:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100ed7:	0f b7 00             	movzwl (%eax),%eax
c0100eda:	0f b7 c0             	movzwl %ax,%eax
c0100edd:	3d 5a a5 00 00       	cmp    $0xa55a,%eax
c0100ee2:	74 12                	je     c0100ef6 <cga_init+0x41>
        cp = (uint16_t*)(MONO_BUF + KERNBASE);
c0100ee4:	c7 45 fc 00 00 0b c0 	movl   $0xc00b0000,-0x4(%ebp)
        addr_6845 = MONO_BASE;
c0100eeb:	66 c7 05 46 c4 11 c0 	movw   $0x3b4,0xc011c446
c0100ef2:	b4 03 
c0100ef4:	eb 13                	jmp    c0100f09 <cga_init+0x54>
    } else {
        *cp = was;
c0100ef6:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100ef9:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c0100efd:	66 89 10             	mov    %dx,(%eax)
        addr_6845 = CGA_BASE;
c0100f00:	66 c7 05 46 c4 11 c0 	movw   $0x3d4,0xc011c446
c0100f07:	d4 03 
    }

    // Extract cursor location
    uint32_t pos;
    outb(addr_6845, 14);
c0100f09:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0100f10:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
c0100f14:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100f18:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0100f1c:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0100f20:	ee                   	out    %al,(%dx)
}
c0100f21:	90                   	nop
    pos = inb(addr_6845 + 1) << 8;
c0100f22:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0100f29:	40                   	inc    %eax
c0100f2a:	0f b7 c0             	movzwl %ax,%eax
c0100f2d:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100f31:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c0100f35:	89 c2                	mov    %eax,%edx
c0100f37:	ec                   	in     (%dx),%al
c0100f38:	88 45 e9             	mov    %al,-0x17(%ebp)
    return data;
c0100f3b:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0100f3f:	0f b6 c0             	movzbl %al,%eax
c0100f42:	c1 e0 08             	shl    $0x8,%eax
c0100f45:	89 45 f4             	mov    %eax,-0xc(%ebp)
    outb(addr_6845, 15);
c0100f48:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0100f4f:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c0100f53:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100f57:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0100f5b:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0100f5f:	ee                   	out    %al,(%dx)
}
c0100f60:	90                   	nop
    pos |= inb(addr_6845 + 1);
c0100f61:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0100f68:	40                   	inc    %eax
c0100f69:	0f b7 c0             	movzwl %ax,%eax
c0100f6c:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100f70:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0100f74:	89 c2                	mov    %eax,%edx
c0100f76:	ec                   	in     (%dx),%al
c0100f77:	88 45 f1             	mov    %al,-0xf(%ebp)
    return data;
c0100f7a:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0100f7e:	0f b6 c0             	movzbl %al,%eax
c0100f81:	09 45 f4             	or     %eax,-0xc(%ebp)

    crt_buf = (uint16_t*) cp;
c0100f84:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100f87:	a3 40 c4 11 c0       	mov    %eax,0xc011c440
    crt_pos = pos;
c0100f8c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100f8f:	0f b7 c0             	movzwl %ax,%eax
c0100f92:	66 a3 44 c4 11 c0    	mov    %ax,0xc011c444
}
c0100f98:	90                   	nop
c0100f99:	89 ec                	mov    %ebp,%esp
c0100f9b:	5d                   	pop    %ebp
c0100f9c:	c3                   	ret    

c0100f9d <serial_init>:

static bool serial_exists = 0;

static void
serial_init(void) {
c0100f9d:	55                   	push   %ebp
c0100f9e:	89 e5                	mov    %esp,%ebp
c0100fa0:	83 ec 48             	sub    $0x48,%esp
c0100fa3:	66 c7 45 d2 fa 03    	movw   $0x3fa,-0x2e(%ebp)
c0100fa9:	c6 45 d1 00          	movb   $0x0,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100fad:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c0100fb1:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c0100fb5:	ee                   	out    %al,(%dx)
}
c0100fb6:	90                   	nop
c0100fb7:	66 c7 45 d6 fb 03    	movw   $0x3fb,-0x2a(%ebp)
c0100fbd:	c6 45 d5 80          	movb   $0x80,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100fc1:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c0100fc5:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c0100fc9:	ee                   	out    %al,(%dx)
}
c0100fca:	90                   	nop
c0100fcb:	66 c7 45 da f8 03    	movw   $0x3f8,-0x26(%ebp)
c0100fd1:	c6 45 d9 0c          	movb   $0xc,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100fd5:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c0100fd9:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c0100fdd:	ee                   	out    %al,(%dx)
}
c0100fde:	90                   	nop
c0100fdf:	66 c7 45 de f9 03    	movw   $0x3f9,-0x22(%ebp)
c0100fe5:	c6 45 dd 00          	movb   $0x0,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100fe9:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c0100fed:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c0100ff1:	ee                   	out    %al,(%dx)
}
c0100ff2:	90                   	nop
c0100ff3:	66 c7 45 e2 fb 03    	movw   $0x3fb,-0x1e(%ebp)
c0100ff9:	c6 45 e1 03          	movb   $0x3,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100ffd:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c0101001:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c0101005:	ee                   	out    %al,(%dx)
}
c0101006:	90                   	nop
c0101007:	66 c7 45 e6 fc 03    	movw   $0x3fc,-0x1a(%ebp)
c010100d:	c6 45 e5 00          	movb   $0x0,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101011:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0101015:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101019:	ee                   	out    %al,(%dx)
}
c010101a:	90                   	nop
c010101b:	66 c7 45 ea f9 03    	movw   $0x3f9,-0x16(%ebp)
c0101021:	c6 45 e9 01          	movb   $0x1,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101025:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101029:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c010102d:	ee                   	out    %al,(%dx)
}
c010102e:	90                   	nop
c010102f:	66 c7 45 ee fd 03    	movw   $0x3fd,-0x12(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101035:	0f b7 45 ee          	movzwl -0x12(%ebp),%eax
c0101039:	89 c2                	mov    %eax,%edx
c010103b:	ec                   	in     (%dx),%al
c010103c:	88 45 ed             	mov    %al,-0x13(%ebp)
    return data;
c010103f:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
    // Enable rcv interrupts
    outb(COM1 + COM_IER, COM_IER_RDI);

    // Clear any preexisting overrun indications and interrupts
    // Serial port doesn't exist if COM_LSR returns 0xFF
    serial_exists = (inb(COM1 + COM_LSR) != 0xFF);
c0101043:	3c ff                	cmp    $0xff,%al
c0101045:	0f 95 c0             	setne  %al
c0101048:	0f b6 c0             	movzbl %al,%eax
c010104b:	a3 48 c4 11 c0       	mov    %eax,0xc011c448
c0101050:	66 c7 45 f2 fa 03    	movw   $0x3fa,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101056:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c010105a:	89 c2                	mov    %eax,%edx
c010105c:	ec                   	in     (%dx),%al
c010105d:	88 45 f1             	mov    %al,-0xf(%ebp)
c0101060:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
c0101066:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c010106a:	89 c2                	mov    %eax,%edx
c010106c:	ec                   	in     (%dx),%al
c010106d:	88 45 f5             	mov    %al,-0xb(%ebp)
    (void) inb(COM1+COM_IIR);
    (void) inb(COM1+COM_RX);

    if (serial_exists) {
c0101070:	a1 48 c4 11 c0       	mov    0xc011c448,%eax
c0101075:	85 c0                	test   %eax,%eax
c0101077:	74 0c                	je     c0101085 <serial_init+0xe8>
        pic_enable(IRQ_COM1);
c0101079:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
c0101080:	e8 27 07 00 00       	call   c01017ac <pic_enable>
    }
}
c0101085:	90                   	nop
c0101086:	89 ec                	mov    %ebp,%esp
c0101088:	5d                   	pop    %ebp
c0101089:	c3                   	ret    

c010108a <lpt_putc_sub>:

static void
lpt_putc_sub(int c) {
c010108a:	55                   	push   %ebp
c010108b:	89 e5                	mov    %esp,%ebp
c010108d:	83 ec 20             	sub    $0x20,%esp
    int i;
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c0101090:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c0101097:	eb 08                	jmp    c01010a1 <lpt_putc_sub+0x17>
        delay();
c0101099:	e8 cc fd ff ff       	call   c0100e6a <delay>
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c010109e:	ff 45 fc             	incl   -0x4(%ebp)
c01010a1:	66 c7 45 fa 79 03    	movw   $0x379,-0x6(%ebp)
c01010a7:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c01010ab:	89 c2                	mov    %eax,%edx
c01010ad:	ec                   	in     (%dx),%al
c01010ae:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c01010b1:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c01010b5:	84 c0                	test   %al,%al
c01010b7:	78 09                	js     c01010c2 <lpt_putc_sub+0x38>
c01010b9:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
c01010c0:	7e d7                	jle    c0101099 <lpt_putc_sub+0xf>
    }
    outb(LPTPORT + 0, c);
c01010c2:	8b 45 08             	mov    0x8(%ebp),%eax
c01010c5:	0f b6 c0             	movzbl %al,%eax
c01010c8:	66 c7 45 ee 78 03    	movw   $0x378,-0x12(%ebp)
c01010ce:	88 45 ed             	mov    %al,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01010d1:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c01010d5:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c01010d9:	ee                   	out    %al,(%dx)
}
c01010da:	90                   	nop
c01010db:	66 c7 45 f2 7a 03    	movw   $0x37a,-0xe(%ebp)
c01010e1:	c6 45 f1 0d          	movb   $0xd,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01010e5:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c01010e9:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c01010ed:	ee                   	out    %al,(%dx)
}
c01010ee:	90                   	nop
c01010ef:	66 c7 45 f6 7a 03    	movw   $0x37a,-0xa(%ebp)
c01010f5:	c6 45 f5 08          	movb   $0x8,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01010f9:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c01010fd:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101101:	ee                   	out    %al,(%dx)
}
c0101102:	90                   	nop
    outb(LPTPORT + 2, 0x08 | 0x04 | 0x01);
    outb(LPTPORT + 2, 0x08);
}
c0101103:	90                   	nop
c0101104:	89 ec                	mov    %ebp,%esp
c0101106:	5d                   	pop    %ebp
c0101107:	c3                   	ret    

c0101108 <lpt_putc>:

/* lpt_putc - copy console output to parallel port */
static void
lpt_putc(int c) {
c0101108:	55                   	push   %ebp
c0101109:	89 e5                	mov    %esp,%ebp
c010110b:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
c010110e:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c0101112:	74 0d                	je     c0101121 <lpt_putc+0x19>
        lpt_putc_sub(c);
c0101114:	8b 45 08             	mov    0x8(%ebp),%eax
c0101117:	89 04 24             	mov    %eax,(%esp)
c010111a:	e8 6b ff ff ff       	call   c010108a <lpt_putc_sub>
    else {
        lpt_putc_sub('\b');
        lpt_putc_sub(' ');
        lpt_putc_sub('\b');
    }
}
c010111f:	eb 24                	jmp    c0101145 <lpt_putc+0x3d>
        lpt_putc_sub('\b');
c0101121:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101128:	e8 5d ff ff ff       	call   c010108a <lpt_putc_sub>
        lpt_putc_sub(' ');
c010112d:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c0101134:	e8 51 ff ff ff       	call   c010108a <lpt_putc_sub>
        lpt_putc_sub('\b');
c0101139:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101140:	e8 45 ff ff ff       	call   c010108a <lpt_putc_sub>
}
c0101145:	90                   	nop
c0101146:	89 ec                	mov    %ebp,%esp
c0101148:	5d                   	pop    %ebp
c0101149:	c3                   	ret    

c010114a <cga_putc>:

/* cga_putc - print character to console */
static void
cga_putc(int c) {
c010114a:	55                   	push   %ebp
c010114b:	89 e5                	mov    %esp,%ebp
c010114d:	83 ec 38             	sub    $0x38,%esp
c0101150:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    // set black on white
    if (!(c & ~0xFF)) {
c0101153:	8b 45 08             	mov    0x8(%ebp),%eax
c0101156:	25 00 ff ff ff       	and    $0xffffff00,%eax
c010115b:	85 c0                	test   %eax,%eax
c010115d:	75 07                	jne    c0101166 <cga_putc+0x1c>
        c |= 0x0700;
c010115f:	81 4d 08 00 07 00 00 	orl    $0x700,0x8(%ebp)
    }

    switch (c & 0xff) {
c0101166:	8b 45 08             	mov    0x8(%ebp),%eax
c0101169:	0f b6 c0             	movzbl %al,%eax
c010116c:	83 f8 0d             	cmp    $0xd,%eax
c010116f:	74 72                	je     c01011e3 <cga_putc+0x99>
c0101171:	83 f8 0d             	cmp    $0xd,%eax
c0101174:	0f 8f a3 00 00 00    	jg     c010121d <cga_putc+0xd3>
c010117a:	83 f8 08             	cmp    $0x8,%eax
c010117d:	74 0a                	je     c0101189 <cga_putc+0x3f>
c010117f:	83 f8 0a             	cmp    $0xa,%eax
c0101182:	74 4c                	je     c01011d0 <cga_putc+0x86>
c0101184:	e9 94 00 00 00       	jmp    c010121d <cga_putc+0xd3>
    case '\b':
        if (crt_pos > 0) {
c0101189:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c0101190:	85 c0                	test   %eax,%eax
c0101192:	0f 84 af 00 00 00    	je     c0101247 <cga_putc+0xfd>
            crt_pos --;
c0101198:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c010119f:	48                   	dec    %eax
c01011a0:	0f b7 c0             	movzwl %ax,%eax
c01011a3:	66 a3 44 c4 11 c0    	mov    %ax,0xc011c444
            crt_buf[crt_pos] = (c & ~0xff) | ' ';
c01011a9:	8b 45 08             	mov    0x8(%ebp),%eax
c01011ac:	98                   	cwtl   
c01011ad:	25 00 ff ff ff       	and    $0xffffff00,%eax
c01011b2:	98                   	cwtl   
c01011b3:	83 c8 20             	or     $0x20,%eax
c01011b6:	98                   	cwtl   
c01011b7:	8b 0d 40 c4 11 c0    	mov    0xc011c440,%ecx
c01011bd:	0f b7 15 44 c4 11 c0 	movzwl 0xc011c444,%edx
c01011c4:	01 d2                	add    %edx,%edx
c01011c6:	01 ca                	add    %ecx,%edx
c01011c8:	0f b7 c0             	movzwl %ax,%eax
c01011cb:	66 89 02             	mov    %ax,(%edx)
        }
        break;
c01011ce:	eb 77                	jmp    c0101247 <cga_putc+0xfd>
    case '\n':
        crt_pos += CRT_COLS;
c01011d0:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c01011d7:	83 c0 50             	add    $0x50,%eax
c01011da:	0f b7 c0             	movzwl %ax,%eax
c01011dd:	66 a3 44 c4 11 c0    	mov    %ax,0xc011c444
    case '\r':
        crt_pos -= (crt_pos % CRT_COLS);
c01011e3:	0f b7 1d 44 c4 11 c0 	movzwl 0xc011c444,%ebx
c01011ea:	0f b7 0d 44 c4 11 c0 	movzwl 0xc011c444,%ecx
c01011f1:	ba cd cc cc cc       	mov    $0xcccccccd,%edx
c01011f6:	89 c8                	mov    %ecx,%eax
c01011f8:	f7 e2                	mul    %edx
c01011fa:	c1 ea 06             	shr    $0x6,%edx
c01011fd:	89 d0                	mov    %edx,%eax
c01011ff:	c1 e0 02             	shl    $0x2,%eax
c0101202:	01 d0                	add    %edx,%eax
c0101204:	c1 e0 04             	shl    $0x4,%eax
c0101207:	29 c1                	sub    %eax,%ecx
c0101209:	89 ca                	mov    %ecx,%edx
c010120b:	0f b7 d2             	movzwl %dx,%edx
c010120e:	89 d8                	mov    %ebx,%eax
c0101210:	29 d0                	sub    %edx,%eax
c0101212:	0f b7 c0             	movzwl %ax,%eax
c0101215:	66 a3 44 c4 11 c0    	mov    %ax,0xc011c444
        break;
c010121b:	eb 2b                	jmp    c0101248 <cga_putc+0xfe>
    default:
        crt_buf[crt_pos ++] = c;     // write the character
c010121d:	8b 0d 40 c4 11 c0    	mov    0xc011c440,%ecx
c0101223:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c010122a:	8d 50 01             	lea    0x1(%eax),%edx
c010122d:	0f b7 d2             	movzwl %dx,%edx
c0101230:	66 89 15 44 c4 11 c0 	mov    %dx,0xc011c444
c0101237:	01 c0                	add    %eax,%eax
c0101239:	8d 14 01             	lea    (%ecx,%eax,1),%edx
c010123c:	8b 45 08             	mov    0x8(%ebp),%eax
c010123f:	0f b7 c0             	movzwl %ax,%eax
c0101242:	66 89 02             	mov    %ax,(%edx)
        break;
c0101245:	eb 01                	jmp    c0101248 <cga_putc+0xfe>
        break;
c0101247:	90                   	nop
    }

    // What is the purpose of this?
    if (crt_pos >= CRT_SIZE) {
c0101248:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c010124f:	3d cf 07 00 00       	cmp    $0x7cf,%eax
c0101254:	76 5e                	jbe    c01012b4 <cga_putc+0x16a>
        int i;
        memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
c0101256:	a1 40 c4 11 c0       	mov    0xc011c440,%eax
c010125b:	8d 90 a0 00 00 00    	lea    0xa0(%eax),%edx
c0101261:	a1 40 c4 11 c0       	mov    0xc011c440,%eax
c0101266:	c7 44 24 08 00 0f 00 	movl   $0xf00,0x8(%esp)
c010126d:	00 
c010126e:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101272:	89 04 24             	mov    %eax,(%esp)
c0101275:	e8 71 4c 00 00       	call   c0105eeb <memmove>
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c010127a:	c7 45 f4 80 07 00 00 	movl   $0x780,-0xc(%ebp)
c0101281:	eb 15                	jmp    c0101298 <cga_putc+0x14e>
            crt_buf[i] = 0x0700 | ' ';
c0101283:	8b 15 40 c4 11 c0    	mov    0xc011c440,%edx
c0101289:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010128c:	01 c0                	add    %eax,%eax
c010128e:	01 d0                	add    %edx,%eax
c0101290:	66 c7 00 20 07       	movw   $0x720,(%eax)
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c0101295:	ff 45 f4             	incl   -0xc(%ebp)
c0101298:	81 7d f4 cf 07 00 00 	cmpl   $0x7cf,-0xc(%ebp)
c010129f:	7e e2                	jle    c0101283 <cga_putc+0x139>
        }
        crt_pos -= CRT_COLS;
c01012a1:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c01012a8:	83 e8 50             	sub    $0x50,%eax
c01012ab:	0f b7 c0             	movzwl %ax,%eax
c01012ae:	66 a3 44 c4 11 c0    	mov    %ax,0xc011c444
    }

    // move that little blinky thing
    outb(addr_6845, 14);
c01012b4:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c01012bb:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
c01012bf:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01012c3:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c01012c7:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c01012cb:	ee                   	out    %al,(%dx)
}
c01012cc:	90                   	nop
    outb(addr_6845 + 1, crt_pos >> 8);
c01012cd:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c01012d4:	c1 e8 08             	shr    $0x8,%eax
c01012d7:	0f b7 c0             	movzwl %ax,%eax
c01012da:	0f b6 c0             	movzbl %al,%eax
c01012dd:	0f b7 15 46 c4 11 c0 	movzwl 0xc011c446,%edx
c01012e4:	42                   	inc    %edx
c01012e5:	0f b7 d2             	movzwl %dx,%edx
c01012e8:	66 89 55 ea          	mov    %dx,-0x16(%ebp)
c01012ec:	88 45 e9             	mov    %al,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01012ef:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c01012f3:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c01012f7:	ee                   	out    %al,(%dx)
}
c01012f8:	90                   	nop
    outb(addr_6845, 15);
c01012f9:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0101300:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c0101304:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101308:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c010130c:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101310:	ee                   	out    %al,(%dx)
}
c0101311:	90                   	nop
    outb(addr_6845 + 1, crt_pos);
c0101312:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c0101319:	0f b6 c0             	movzbl %al,%eax
c010131c:	0f b7 15 46 c4 11 c0 	movzwl 0xc011c446,%edx
c0101323:	42                   	inc    %edx
c0101324:	0f b7 d2             	movzwl %dx,%edx
c0101327:	66 89 55 f2          	mov    %dx,-0xe(%ebp)
c010132b:	88 45 f1             	mov    %al,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010132e:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101332:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101336:	ee                   	out    %al,(%dx)
}
c0101337:	90                   	nop
}
c0101338:	90                   	nop
c0101339:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c010133c:	89 ec                	mov    %ebp,%esp
c010133e:	5d                   	pop    %ebp
c010133f:	c3                   	ret    

c0101340 <serial_putc_sub>:

static void
serial_putc_sub(int c) {
c0101340:	55                   	push   %ebp
c0101341:	89 e5                	mov    %esp,%ebp
c0101343:	83 ec 10             	sub    $0x10,%esp
    int i;
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c0101346:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c010134d:	eb 08                	jmp    c0101357 <serial_putc_sub+0x17>
        delay();
c010134f:	e8 16 fb ff ff       	call   c0100e6a <delay>
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c0101354:	ff 45 fc             	incl   -0x4(%ebp)
c0101357:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c010135d:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0101361:	89 c2                	mov    %eax,%edx
c0101363:	ec                   	in     (%dx),%al
c0101364:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c0101367:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c010136b:	0f b6 c0             	movzbl %al,%eax
c010136e:	83 e0 20             	and    $0x20,%eax
c0101371:	85 c0                	test   %eax,%eax
c0101373:	75 09                	jne    c010137e <serial_putc_sub+0x3e>
c0101375:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
c010137c:	7e d1                	jle    c010134f <serial_putc_sub+0xf>
    }
    outb(COM1 + COM_TX, c);
c010137e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101381:	0f b6 c0             	movzbl %al,%eax
c0101384:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
c010138a:	88 45 f5             	mov    %al,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010138d:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0101391:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101395:	ee                   	out    %al,(%dx)
}
c0101396:	90                   	nop
}
c0101397:	90                   	nop
c0101398:	89 ec                	mov    %ebp,%esp
c010139a:	5d                   	pop    %ebp
c010139b:	c3                   	ret    

c010139c <serial_putc>:

/* serial_putc - print character to serial port */
static void
serial_putc(int c) {
c010139c:	55                   	push   %ebp
c010139d:	89 e5                	mov    %esp,%ebp
c010139f:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
c01013a2:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c01013a6:	74 0d                	je     c01013b5 <serial_putc+0x19>
        serial_putc_sub(c);
c01013a8:	8b 45 08             	mov    0x8(%ebp),%eax
c01013ab:	89 04 24             	mov    %eax,(%esp)
c01013ae:	e8 8d ff ff ff       	call   c0101340 <serial_putc_sub>
    else {
        serial_putc_sub('\b');
        serial_putc_sub(' ');
        serial_putc_sub('\b');
    }
}
c01013b3:	eb 24                	jmp    c01013d9 <serial_putc+0x3d>
        serial_putc_sub('\b');
c01013b5:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c01013bc:	e8 7f ff ff ff       	call   c0101340 <serial_putc_sub>
        serial_putc_sub(' ');
c01013c1:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c01013c8:	e8 73 ff ff ff       	call   c0101340 <serial_putc_sub>
        serial_putc_sub('\b');
c01013cd:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c01013d4:	e8 67 ff ff ff       	call   c0101340 <serial_putc_sub>
}
c01013d9:	90                   	nop
c01013da:	89 ec                	mov    %ebp,%esp
c01013dc:	5d                   	pop    %ebp
c01013dd:	c3                   	ret    

c01013de <cons_intr>:
/* *
 * cons_intr - called by device interrupt routines to feed input
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
c01013de:	55                   	push   %ebp
c01013df:	89 e5                	mov    %esp,%ebp
c01013e1:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = (*proc)()) != -1) {
c01013e4:	eb 33                	jmp    c0101419 <cons_intr+0x3b>
        if (c != 0) {
c01013e6:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01013ea:	74 2d                	je     c0101419 <cons_intr+0x3b>
            cons.buf[cons.wpos ++] = c;
c01013ec:	a1 64 c6 11 c0       	mov    0xc011c664,%eax
c01013f1:	8d 50 01             	lea    0x1(%eax),%edx
c01013f4:	89 15 64 c6 11 c0    	mov    %edx,0xc011c664
c01013fa:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01013fd:	88 90 60 c4 11 c0    	mov    %dl,-0x3fee3ba0(%eax)
            if (cons.wpos == CONSBUFSIZE) {
c0101403:	a1 64 c6 11 c0       	mov    0xc011c664,%eax
c0101408:	3d 00 02 00 00       	cmp    $0x200,%eax
c010140d:	75 0a                	jne    c0101419 <cons_intr+0x3b>
                cons.wpos = 0;
c010140f:	c7 05 64 c6 11 c0 00 	movl   $0x0,0xc011c664
c0101416:	00 00 00 
    while ((c = (*proc)()) != -1) {
c0101419:	8b 45 08             	mov    0x8(%ebp),%eax
c010141c:	ff d0                	call   *%eax
c010141e:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0101421:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
c0101425:	75 bf                	jne    c01013e6 <cons_intr+0x8>
            }
        }
    }
}
c0101427:	90                   	nop
c0101428:	90                   	nop
c0101429:	89 ec                	mov    %ebp,%esp
c010142b:	5d                   	pop    %ebp
c010142c:	c3                   	ret    

c010142d <serial_proc_data>:

/* serial_proc_data - get data from serial port */
static int
serial_proc_data(void) {
c010142d:	55                   	push   %ebp
c010142e:	89 e5                	mov    %esp,%ebp
c0101430:	83 ec 10             	sub    $0x10,%esp
c0101433:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101439:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c010143d:	89 c2                	mov    %eax,%edx
c010143f:	ec                   	in     (%dx),%al
c0101440:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c0101443:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
    if (!(inb(COM1 + COM_LSR) & COM_LSR_DATA)) {
c0101447:	0f b6 c0             	movzbl %al,%eax
c010144a:	83 e0 01             	and    $0x1,%eax
c010144d:	85 c0                	test   %eax,%eax
c010144f:	75 07                	jne    c0101458 <serial_proc_data+0x2b>
        return -1;
c0101451:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0101456:	eb 2a                	jmp    c0101482 <serial_proc_data+0x55>
c0101458:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c010145e:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0101462:	89 c2                	mov    %eax,%edx
c0101464:	ec                   	in     (%dx),%al
c0101465:	88 45 f5             	mov    %al,-0xb(%ebp)
    return data;
c0101468:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
    }
    int c = inb(COM1 + COM_RX);
c010146c:	0f b6 c0             	movzbl %al,%eax
c010146f:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (c == 127) {
c0101472:	83 7d fc 7f          	cmpl   $0x7f,-0x4(%ebp)
c0101476:	75 07                	jne    c010147f <serial_proc_data+0x52>
        c = '\b';
c0101478:	c7 45 fc 08 00 00 00 	movl   $0x8,-0x4(%ebp)
    }
    return c;
c010147f:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0101482:	89 ec                	mov    %ebp,%esp
c0101484:	5d                   	pop    %ebp
c0101485:	c3                   	ret    

c0101486 <serial_intr>:

/* serial_intr - try to feed input characters from serial port */
void
serial_intr(void) {
c0101486:	55                   	push   %ebp
c0101487:	89 e5                	mov    %esp,%ebp
c0101489:	83 ec 18             	sub    $0x18,%esp
    if (serial_exists) {
c010148c:	a1 48 c4 11 c0       	mov    0xc011c448,%eax
c0101491:	85 c0                	test   %eax,%eax
c0101493:	74 0c                	je     c01014a1 <serial_intr+0x1b>
        cons_intr(serial_proc_data);
c0101495:	c7 04 24 2d 14 10 c0 	movl   $0xc010142d,(%esp)
c010149c:	e8 3d ff ff ff       	call   c01013de <cons_intr>
    }
}
c01014a1:	90                   	nop
c01014a2:	89 ec                	mov    %ebp,%esp
c01014a4:	5d                   	pop    %ebp
c01014a5:	c3                   	ret    

c01014a6 <kbd_proc_data>:
 *
 * The kbd_proc_data() function gets data from the keyboard.
 * If we finish a character, return it, else 0. And return -1 if no data.
 * */
static int
kbd_proc_data(void) {
c01014a6:	55                   	push   %ebp
c01014a7:	89 e5                	mov    %esp,%ebp
c01014a9:	83 ec 38             	sub    $0x38,%esp
c01014ac:	66 c7 45 f0 64 00    	movw   $0x64,-0x10(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c01014b2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01014b5:	89 c2                	mov    %eax,%edx
c01014b7:	ec                   	in     (%dx),%al
c01014b8:	88 45 ef             	mov    %al,-0x11(%ebp)
    return data;
c01014bb:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
    int c;
    uint8_t data;
    static uint32_t shift;

    if ((inb(KBSTATP) & KBS_DIB) == 0) {
c01014bf:	0f b6 c0             	movzbl %al,%eax
c01014c2:	83 e0 01             	and    $0x1,%eax
c01014c5:	85 c0                	test   %eax,%eax
c01014c7:	75 0a                	jne    c01014d3 <kbd_proc_data+0x2d>
        return -1;
c01014c9:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01014ce:	e9 56 01 00 00       	jmp    c0101629 <kbd_proc_data+0x183>
c01014d3:	66 c7 45 ec 60 00    	movw   $0x60,-0x14(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c01014d9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01014dc:	89 c2                	mov    %eax,%edx
c01014de:	ec                   	in     (%dx),%al
c01014df:	88 45 eb             	mov    %al,-0x15(%ebp)
    return data;
c01014e2:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
    }

    data = inb(KBDATAP);
c01014e6:	88 45 f3             	mov    %al,-0xd(%ebp)

    if (data == 0xE0) {
c01014e9:	80 7d f3 e0          	cmpb   $0xe0,-0xd(%ebp)
c01014ed:	75 17                	jne    c0101506 <kbd_proc_data+0x60>
        // E0 escape character
        shift |= E0ESC;
c01014ef:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c01014f4:	83 c8 40             	or     $0x40,%eax
c01014f7:	a3 68 c6 11 c0       	mov    %eax,0xc011c668
        return 0;
c01014fc:	b8 00 00 00 00       	mov    $0x0,%eax
c0101501:	e9 23 01 00 00       	jmp    c0101629 <kbd_proc_data+0x183>
    } else if (data & 0x80) {
c0101506:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c010150a:	84 c0                	test   %al,%al
c010150c:	79 45                	jns    c0101553 <kbd_proc_data+0xad>
        // Key released
        data = (shift & E0ESC ? data : data & 0x7F);
c010150e:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c0101513:	83 e0 40             	and    $0x40,%eax
c0101516:	85 c0                	test   %eax,%eax
c0101518:	75 08                	jne    c0101522 <kbd_proc_data+0x7c>
c010151a:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c010151e:	24 7f                	and    $0x7f,%al
c0101520:	eb 04                	jmp    c0101526 <kbd_proc_data+0x80>
c0101522:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101526:	88 45 f3             	mov    %al,-0xd(%ebp)
        shift &= ~(shiftcode[data] | E0ESC);
c0101529:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c010152d:	0f b6 80 40 90 11 c0 	movzbl -0x3fee6fc0(%eax),%eax
c0101534:	0c 40                	or     $0x40,%al
c0101536:	0f b6 c0             	movzbl %al,%eax
c0101539:	f7 d0                	not    %eax
c010153b:	89 c2                	mov    %eax,%edx
c010153d:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c0101542:	21 d0                	and    %edx,%eax
c0101544:	a3 68 c6 11 c0       	mov    %eax,0xc011c668
        return 0;
c0101549:	b8 00 00 00 00       	mov    $0x0,%eax
c010154e:	e9 d6 00 00 00       	jmp    c0101629 <kbd_proc_data+0x183>
    } else if (shift & E0ESC) {
c0101553:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c0101558:	83 e0 40             	and    $0x40,%eax
c010155b:	85 c0                	test   %eax,%eax
c010155d:	74 11                	je     c0101570 <kbd_proc_data+0xca>
        // Last character was an E0 escape; or with 0x80
        data |= 0x80;
c010155f:	80 4d f3 80          	orb    $0x80,-0xd(%ebp)
        shift &= ~E0ESC;
c0101563:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c0101568:	83 e0 bf             	and    $0xffffffbf,%eax
c010156b:	a3 68 c6 11 c0       	mov    %eax,0xc011c668
    }

    shift |= shiftcode[data];
c0101570:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101574:	0f b6 80 40 90 11 c0 	movzbl -0x3fee6fc0(%eax),%eax
c010157b:	0f b6 d0             	movzbl %al,%edx
c010157e:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c0101583:	09 d0                	or     %edx,%eax
c0101585:	a3 68 c6 11 c0       	mov    %eax,0xc011c668
    shift ^= togglecode[data];
c010158a:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c010158e:	0f b6 80 40 91 11 c0 	movzbl -0x3fee6ec0(%eax),%eax
c0101595:	0f b6 d0             	movzbl %al,%edx
c0101598:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c010159d:	31 d0                	xor    %edx,%eax
c010159f:	a3 68 c6 11 c0       	mov    %eax,0xc011c668

    c = charcode[shift & (CTL | SHIFT)][data];
c01015a4:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c01015a9:	83 e0 03             	and    $0x3,%eax
c01015ac:	8b 14 85 40 95 11 c0 	mov    -0x3fee6ac0(,%eax,4),%edx
c01015b3:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c01015b7:	01 d0                	add    %edx,%eax
c01015b9:	0f b6 00             	movzbl (%eax),%eax
c01015bc:	0f b6 c0             	movzbl %al,%eax
c01015bf:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (shift & CAPSLOCK) {
c01015c2:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c01015c7:	83 e0 08             	and    $0x8,%eax
c01015ca:	85 c0                	test   %eax,%eax
c01015cc:	74 22                	je     c01015f0 <kbd_proc_data+0x14a>
        if ('a' <= c && c <= 'z')
c01015ce:	83 7d f4 60          	cmpl   $0x60,-0xc(%ebp)
c01015d2:	7e 0c                	jle    c01015e0 <kbd_proc_data+0x13a>
c01015d4:	83 7d f4 7a          	cmpl   $0x7a,-0xc(%ebp)
c01015d8:	7f 06                	jg     c01015e0 <kbd_proc_data+0x13a>
            c += 'A' - 'a';
c01015da:	83 6d f4 20          	subl   $0x20,-0xc(%ebp)
c01015de:	eb 10                	jmp    c01015f0 <kbd_proc_data+0x14a>
        else if ('A' <= c && c <= 'Z')
c01015e0:	83 7d f4 40          	cmpl   $0x40,-0xc(%ebp)
c01015e4:	7e 0a                	jle    c01015f0 <kbd_proc_data+0x14a>
c01015e6:	83 7d f4 5a          	cmpl   $0x5a,-0xc(%ebp)
c01015ea:	7f 04                	jg     c01015f0 <kbd_proc_data+0x14a>
            c += 'a' - 'A';
c01015ec:	83 45 f4 20          	addl   $0x20,-0xc(%ebp)
    }

    // Process special keys
    // Ctrl-Alt-Del: reboot
    if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
c01015f0:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c01015f5:	f7 d0                	not    %eax
c01015f7:	83 e0 06             	and    $0x6,%eax
c01015fa:	85 c0                	test   %eax,%eax
c01015fc:	75 28                	jne    c0101626 <kbd_proc_data+0x180>
c01015fe:	81 7d f4 e9 00 00 00 	cmpl   $0xe9,-0xc(%ebp)
c0101605:	75 1f                	jne    c0101626 <kbd_proc_data+0x180>
        cprintf("Rebooting!\n");
c0101607:	c7 04 24 6f 63 10 c0 	movl   $0xc010636f,(%esp)
c010160e:	e8 53 ed ff ff       	call   c0100366 <cprintf>
c0101613:	66 c7 45 e8 92 00    	movw   $0x92,-0x18(%ebp)
c0101619:	c6 45 e7 03          	movb   $0x3,-0x19(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010161d:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
c0101621:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0101624:	ee                   	out    %al,(%dx)
}
c0101625:	90                   	nop
        outb(0x92, 0x3); // courtesy of Chris Frost
    }
    return c;
c0101626:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0101629:	89 ec                	mov    %ebp,%esp
c010162b:	5d                   	pop    %ebp
c010162c:	c3                   	ret    

c010162d <kbd_intr>:

/* kbd_intr - try to feed input characters from keyboard */
static void
kbd_intr(void) {
c010162d:	55                   	push   %ebp
c010162e:	89 e5                	mov    %esp,%ebp
c0101630:	83 ec 18             	sub    $0x18,%esp
    cons_intr(kbd_proc_data);
c0101633:	c7 04 24 a6 14 10 c0 	movl   $0xc01014a6,(%esp)
c010163a:	e8 9f fd ff ff       	call   c01013de <cons_intr>
}
c010163f:	90                   	nop
c0101640:	89 ec                	mov    %ebp,%esp
c0101642:	5d                   	pop    %ebp
c0101643:	c3                   	ret    

c0101644 <kbd_init>:

static void
kbd_init(void) {
c0101644:	55                   	push   %ebp
c0101645:	89 e5                	mov    %esp,%ebp
c0101647:	83 ec 18             	sub    $0x18,%esp
    // drain the kbd buffer
    kbd_intr();
c010164a:	e8 de ff ff ff       	call   c010162d <kbd_intr>
    pic_enable(IRQ_KBD);
c010164f:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0101656:	e8 51 01 00 00       	call   c01017ac <pic_enable>
}
c010165b:	90                   	nop
c010165c:	89 ec                	mov    %ebp,%esp
c010165e:	5d                   	pop    %ebp
c010165f:	c3                   	ret    

c0101660 <cons_init>:

/* cons_init - initializes the console devices */
void
cons_init(void) {
c0101660:	55                   	push   %ebp
c0101661:	89 e5                	mov    %esp,%ebp
c0101663:	83 ec 18             	sub    $0x18,%esp
    cga_init();
c0101666:	e8 4a f8 ff ff       	call   c0100eb5 <cga_init>
    serial_init();
c010166b:	e8 2d f9 ff ff       	call   c0100f9d <serial_init>
    kbd_init();
c0101670:	e8 cf ff ff ff       	call   c0101644 <kbd_init>
    if (!serial_exists) {
c0101675:	a1 48 c4 11 c0       	mov    0xc011c448,%eax
c010167a:	85 c0                	test   %eax,%eax
c010167c:	75 0c                	jne    c010168a <cons_init+0x2a>
        cprintf("serial port does not exist!!\n");
c010167e:	c7 04 24 7b 63 10 c0 	movl   $0xc010637b,(%esp)
c0101685:	e8 dc ec ff ff       	call   c0100366 <cprintf>
    }
}
c010168a:	90                   	nop
c010168b:	89 ec                	mov    %ebp,%esp
c010168d:	5d                   	pop    %ebp
c010168e:	c3                   	ret    

c010168f <cons_putc>:

/* cons_putc - print a single character @c to console devices */
void
cons_putc(int c) {
c010168f:	55                   	push   %ebp
c0101690:	89 e5                	mov    %esp,%ebp
c0101692:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
c0101695:	e8 8e f7 ff ff       	call   c0100e28 <__intr_save>
c010169a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        lpt_putc(c);
c010169d:	8b 45 08             	mov    0x8(%ebp),%eax
c01016a0:	89 04 24             	mov    %eax,(%esp)
c01016a3:	e8 60 fa ff ff       	call   c0101108 <lpt_putc>
        cga_putc(c);
c01016a8:	8b 45 08             	mov    0x8(%ebp),%eax
c01016ab:	89 04 24             	mov    %eax,(%esp)
c01016ae:	e8 97 fa ff ff       	call   c010114a <cga_putc>
        serial_putc(c);
c01016b3:	8b 45 08             	mov    0x8(%ebp),%eax
c01016b6:	89 04 24             	mov    %eax,(%esp)
c01016b9:	e8 de fc ff ff       	call   c010139c <serial_putc>
    }
    local_intr_restore(intr_flag);
c01016be:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01016c1:	89 04 24             	mov    %eax,(%esp)
c01016c4:	e8 8b f7 ff ff       	call   c0100e54 <__intr_restore>
}
c01016c9:	90                   	nop
c01016ca:	89 ec                	mov    %ebp,%esp
c01016cc:	5d                   	pop    %ebp
c01016cd:	c3                   	ret    

c01016ce <cons_getc>:
/* *
 * cons_getc - return the next input character from console,
 * or 0 if none waiting.
 * */
int
cons_getc(void) {
c01016ce:	55                   	push   %ebp
c01016cf:	89 e5                	mov    %esp,%ebp
c01016d1:	83 ec 28             	sub    $0x28,%esp
    int c = 0;
c01016d4:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
c01016db:	e8 48 f7 ff ff       	call   c0100e28 <__intr_save>
c01016e0:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        // poll for any pending input characters,
        // so that this function works even when interrupts are disabled
        // (e.g., when called from the kernel monitor).
        serial_intr();
c01016e3:	e8 9e fd ff ff       	call   c0101486 <serial_intr>
        kbd_intr();
c01016e8:	e8 40 ff ff ff       	call   c010162d <kbd_intr>

        // grab the next character from the input buffer.
        if (cons.rpos != cons.wpos) {
c01016ed:	8b 15 60 c6 11 c0    	mov    0xc011c660,%edx
c01016f3:	a1 64 c6 11 c0       	mov    0xc011c664,%eax
c01016f8:	39 c2                	cmp    %eax,%edx
c01016fa:	74 31                	je     c010172d <cons_getc+0x5f>
            c = cons.buf[cons.rpos ++];
c01016fc:	a1 60 c6 11 c0       	mov    0xc011c660,%eax
c0101701:	8d 50 01             	lea    0x1(%eax),%edx
c0101704:	89 15 60 c6 11 c0    	mov    %edx,0xc011c660
c010170a:	0f b6 80 60 c4 11 c0 	movzbl -0x3fee3ba0(%eax),%eax
c0101711:	0f b6 c0             	movzbl %al,%eax
c0101714:	89 45 f4             	mov    %eax,-0xc(%ebp)
            if (cons.rpos == CONSBUFSIZE) {
c0101717:	a1 60 c6 11 c0       	mov    0xc011c660,%eax
c010171c:	3d 00 02 00 00       	cmp    $0x200,%eax
c0101721:	75 0a                	jne    c010172d <cons_getc+0x5f>
                cons.rpos = 0;
c0101723:	c7 05 60 c6 11 c0 00 	movl   $0x0,0xc011c660
c010172a:	00 00 00 
            }
        }
    }
    local_intr_restore(intr_flag);
c010172d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101730:	89 04 24             	mov    %eax,(%esp)
c0101733:	e8 1c f7 ff ff       	call   c0100e54 <__intr_restore>
    return c;
c0101738:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010173b:	89 ec                	mov    %ebp,%esp
c010173d:	5d                   	pop    %ebp
c010173e:	c3                   	ret    

c010173f <intr_enable>:
#include <x86.h>
#include <intr.h>

/* intr_enable - enable irq interrupt */
void
intr_enable(void) {
c010173f:	55                   	push   %ebp
c0101740:	89 e5                	mov    %esp,%ebp
    asm volatile ("sti");
c0101742:	fb                   	sti    
}
c0101743:	90                   	nop
    sti();
}
c0101744:	90                   	nop
c0101745:	5d                   	pop    %ebp
c0101746:	c3                   	ret    

c0101747 <intr_disable>:

/* intr_disable - disable irq interrupt */
void
intr_disable(void) {
c0101747:	55                   	push   %ebp
c0101748:	89 e5                	mov    %esp,%ebp
    asm volatile ("cli" ::: "memory");
c010174a:	fa                   	cli    
}
c010174b:	90                   	nop
    cli();
}
c010174c:	90                   	nop
c010174d:	5d                   	pop    %ebp
c010174e:	c3                   	ret    

c010174f <pic_setmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static uint16_t irq_mask = 0xFFFF & ~(1 << IRQ_SLAVE);
static bool did_init = 0;

static void
pic_setmask(uint16_t mask) {
c010174f:	55                   	push   %ebp
c0101750:	89 e5                	mov    %esp,%ebp
c0101752:	83 ec 14             	sub    $0x14,%esp
c0101755:	8b 45 08             	mov    0x8(%ebp),%eax
c0101758:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
    irq_mask = mask;
c010175c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010175f:	66 a3 50 95 11 c0    	mov    %ax,0xc0119550
    if (did_init) {
c0101765:	a1 6c c6 11 c0       	mov    0xc011c66c,%eax
c010176a:	85 c0                	test   %eax,%eax
c010176c:	74 39                	je     c01017a7 <pic_setmask+0x58>
        outb(IO_PIC1 + 1, mask);
c010176e:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101771:	0f b6 c0             	movzbl %al,%eax
c0101774:	66 c7 45 fa 21 00    	movw   $0x21,-0x6(%ebp)
c010177a:	88 45 f9             	mov    %al,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010177d:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c0101781:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c0101785:	ee                   	out    %al,(%dx)
}
c0101786:	90                   	nop
        outb(IO_PIC2 + 1, mask >> 8);
c0101787:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c010178b:	c1 e8 08             	shr    $0x8,%eax
c010178e:	0f b7 c0             	movzwl %ax,%eax
c0101791:	0f b6 c0             	movzbl %al,%eax
c0101794:	66 c7 45 fe a1 00    	movw   $0xa1,-0x2(%ebp)
c010179a:	88 45 fd             	mov    %al,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010179d:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c01017a1:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c01017a5:	ee                   	out    %al,(%dx)
}
c01017a6:	90                   	nop
    }
}
c01017a7:	90                   	nop
c01017a8:	89 ec                	mov    %ebp,%esp
c01017aa:	5d                   	pop    %ebp
c01017ab:	c3                   	ret    

c01017ac <pic_enable>:

void
pic_enable(unsigned int irq) {
c01017ac:	55                   	push   %ebp
c01017ad:	89 e5                	mov    %esp,%ebp
c01017af:	83 ec 04             	sub    $0x4,%esp
    pic_setmask(irq_mask & ~(1 << irq));
c01017b2:	8b 45 08             	mov    0x8(%ebp),%eax
c01017b5:	ba 01 00 00 00       	mov    $0x1,%edx
c01017ba:	88 c1                	mov    %al,%cl
c01017bc:	d3 e2                	shl    %cl,%edx
c01017be:	89 d0                	mov    %edx,%eax
c01017c0:	98                   	cwtl   
c01017c1:	f7 d0                	not    %eax
c01017c3:	0f bf d0             	movswl %ax,%edx
c01017c6:	0f b7 05 50 95 11 c0 	movzwl 0xc0119550,%eax
c01017cd:	98                   	cwtl   
c01017ce:	21 d0                	and    %edx,%eax
c01017d0:	98                   	cwtl   
c01017d1:	0f b7 c0             	movzwl %ax,%eax
c01017d4:	89 04 24             	mov    %eax,(%esp)
c01017d7:	e8 73 ff ff ff       	call   c010174f <pic_setmask>
}
c01017dc:	90                   	nop
c01017dd:	89 ec                	mov    %ebp,%esp
c01017df:	5d                   	pop    %ebp
c01017e0:	c3                   	ret    

c01017e1 <pic_init>:

/* pic_init - initialize the 8259A interrupt controllers */
void
pic_init(void) {
c01017e1:	55                   	push   %ebp
c01017e2:	89 e5                	mov    %esp,%ebp
c01017e4:	83 ec 44             	sub    $0x44,%esp
    did_init = 1;
c01017e7:	c7 05 6c c6 11 c0 01 	movl   $0x1,0xc011c66c
c01017ee:	00 00 00 
c01017f1:	66 c7 45 ca 21 00    	movw   $0x21,-0x36(%ebp)
c01017f7:	c6 45 c9 ff          	movb   $0xff,-0x37(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01017fb:	0f b6 45 c9          	movzbl -0x37(%ebp),%eax
c01017ff:	0f b7 55 ca          	movzwl -0x36(%ebp),%edx
c0101803:	ee                   	out    %al,(%dx)
}
c0101804:	90                   	nop
c0101805:	66 c7 45 ce a1 00    	movw   $0xa1,-0x32(%ebp)
c010180b:	c6 45 cd ff          	movb   $0xff,-0x33(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010180f:	0f b6 45 cd          	movzbl -0x33(%ebp),%eax
c0101813:	0f b7 55 ce          	movzwl -0x32(%ebp),%edx
c0101817:	ee                   	out    %al,(%dx)
}
c0101818:	90                   	nop
c0101819:	66 c7 45 d2 20 00    	movw   $0x20,-0x2e(%ebp)
c010181f:	c6 45 d1 11          	movb   $0x11,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101823:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c0101827:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c010182b:	ee                   	out    %al,(%dx)
}
c010182c:	90                   	nop
c010182d:	66 c7 45 d6 21 00    	movw   $0x21,-0x2a(%ebp)
c0101833:	c6 45 d5 20          	movb   $0x20,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101837:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c010183b:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c010183f:	ee                   	out    %al,(%dx)
}
c0101840:	90                   	nop
c0101841:	66 c7 45 da 21 00    	movw   $0x21,-0x26(%ebp)
c0101847:	c6 45 d9 04          	movb   $0x4,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010184b:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c010184f:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c0101853:	ee                   	out    %al,(%dx)
}
c0101854:	90                   	nop
c0101855:	66 c7 45 de 21 00    	movw   $0x21,-0x22(%ebp)
c010185b:	c6 45 dd 03          	movb   $0x3,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010185f:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c0101863:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c0101867:	ee                   	out    %al,(%dx)
}
c0101868:	90                   	nop
c0101869:	66 c7 45 e2 a0 00    	movw   $0xa0,-0x1e(%ebp)
c010186f:	c6 45 e1 11          	movb   $0x11,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101873:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c0101877:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c010187b:	ee                   	out    %al,(%dx)
}
c010187c:	90                   	nop
c010187d:	66 c7 45 e6 a1 00    	movw   $0xa1,-0x1a(%ebp)
c0101883:	c6 45 e5 28          	movb   $0x28,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101887:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c010188b:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c010188f:	ee                   	out    %al,(%dx)
}
c0101890:	90                   	nop
c0101891:	66 c7 45 ea a1 00    	movw   $0xa1,-0x16(%ebp)
c0101897:	c6 45 e9 02          	movb   $0x2,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010189b:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c010189f:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c01018a3:	ee                   	out    %al,(%dx)
}
c01018a4:	90                   	nop
c01018a5:	66 c7 45 ee a1 00    	movw   $0xa1,-0x12(%ebp)
c01018ab:	c6 45 ed 03          	movb   $0x3,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01018af:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c01018b3:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c01018b7:	ee                   	out    %al,(%dx)
}
c01018b8:	90                   	nop
c01018b9:	66 c7 45 f2 20 00    	movw   $0x20,-0xe(%ebp)
c01018bf:	c6 45 f1 68          	movb   $0x68,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01018c3:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c01018c7:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c01018cb:	ee                   	out    %al,(%dx)
}
c01018cc:	90                   	nop
c01018cd:	66 c7 45 f6 20 00    	movw   $0x20,-0xa(%ebp)
c01018d3:	c6 45 f5 0a          	movb   $0xa,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01018d7:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c01018db:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c01018df:	ee                   	out    %al,(%dx)
}
c01018e0:	90                   	nop
c01018e1:	66 c7 45 fa a0 00    	movw   $0xa0,-0x6(%ebp)
c01018e7:	c6 45 f9 68          	movb   $0x68,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01018eb:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c01018ef:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c01018f3:	ee                   	out    %al,(%dx)
}
c01018f4:	90                   	nop
c01018f5:	66 c7 45 fe a0 00    	movw   $0xa0,-0x2(%ebp)
c01018fb:	c6 45 fd 0a          	movb   $0xa,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01018ff:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c0101903:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c0101907:	ee                   	out    %al,(%dx)
}
c0101908:	90                   	nop
    outb(IO_PIC1, 0x0a);    // read IRR by default

    outb(IO_PIC2, 0x68);    // OCW3
    outb(IO_PIC2, 0x0a);    // OCW3

    if (irq_mask != 0xFFFF) {
c0101909:	0f b7 05 50 95 11 c0 	movzwl 0xc0119550,%eax
c0101910:	3d ff ff 00 00       	cmp    $0xffff,%eax
c0101915:	74 0f                	je     c0101926 <pic_init+0x145>
        pic_setmask(irq_mask);
c0101917:	0f b7 05 50 95 11 c0 	movzwl 0xc0119550,%eax
c010191e:	89 04 24             	mov    %eax,(%esp)
c0101921:	e8 29 fe ff ff       	call   c010174f <pic_setmask>
    }
}
c0101926:	90                   	nop
c0101927:	89 ec                	mov    %ebp,%esp
c0101929:	5d                   	pop    %ebp
c010192a:	c3                   	ret    

c010192b <print_ticks>:
#include <console.h>
#include <kdebug.h>
#include<string.h>
#define TICK_NUM 100

static void print_ticks() {
c010192b:	55                   	push   %ebp
c010192c:	89 e5                	mov    %esp,%ebp
c010192e:	83 ec 18             	sub    $0x18,%esp
    cprintf("%d ticks\n",TICK_NUM);
c0101931:	c7 44 24 04 64 00 00 	movl   $0x64,0x4(%esp)
c0101938:	00 
c0101939:	c7 04 24 a0 63 10 c0 	movl   $0xc01063a0,(%esp)
c0101940:	e8 21 ea ff ff       	call   c0100366 <cprintf>
#ifdef DEBUG_GRADE
    cprintf("End of Test.\n");
    panic("EOT: kernel seems ok.");
#endif
}
c0101945:	90                   	nop
c0101946:	89 ec                	mov    %ebp,%esp
c0101948:	5d                   	pop    %ebp
c0101949:	c3                   	ret    

c010194a <idt_init>:
    sizeof(idt) - 1, (uintptr_t)idt
};

/* idt_init - initialize IDT to each of the entry points in kern/trap/vectors.S */
void
idt_init(void) {
c010194a:	55                   	push   %ebp
c010194b:	89 e5                	mov    %esp,%ebp
c010194d:	83 ec 10             	sub    $0x10,%esp
    //set up idt
    // for(int i=0;i<256;i++){
    //     SETGATE(idt[i],0,0,__vectors[i],0)
    // }
    int i;
    for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i++){
c0101950:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c0101957:	e9 c4 00 00 00       	jmp    c0101a20 <idt_init+0xd6>
        SETGATE(idt[i],0,GD_KTEXT,__vectors[i],DPL_KERNEL);
c010195c:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010195f:	8b 04 85 e0 95 11 c0 	mov    -0x3fee6a20(,%eax,4),%eax
c0101966:	0f b7 d0             	movzwl %ax,%edx
c0101969:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010196c:	66 89 14 c5 a0 c6 11 	mov    %dx,-0x3fee3960(,%eax,8)
c0101973:	c0 
c0101974:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101977:	66 c7 04 c5 a2 c6 11 	movw   $0x8,-0x3fee395e(,%eax,8)
c010197e:	c0 08 00 
c0101981:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101984:	0f b6 14 c5 a4 c6 11 	movzbl -0x3fee395c(,%eax,8),%edx
c010198b:	c0 
c010198c:	80 e2 e0             	and    $0xe0,%dl
c010198f:	88 14 c5 a4 c6 11 c0 	mov    %dl,-0x3fee395c(,%eax,8)
c0101996:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101999:	0f b6 14 c5 a4 c6 11 	movzbl -0x3fee395c(,%eax,8),%edx
c01019a0:	c0 
c01019a1:	80 e2 1f             	and    $0x1f,%dl
c01019a4:	88 14 c5 a4 c6 11 c0 	mov    %dl,-0x3fee395c(,%eax,8)
c01019ab:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01019ae:	0f b6 14 c5 a5 c6 11 	movzbl -0x3fee395b(,%eax,8),%edx
c01019b5:	c0 
c01019b6:	80 e2 f0             	and    $0xf0,%dl
c01019b9:	80 ca 0e             	or     $0xe,%dl
c01019bc:	88 14 c5 a5 c6 11 c0 	mov    %dl,-0x3fee395b(,%eax,8)
c01019c3:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01019c6:	0f b6 14 c5 a5 c6 11 	movzbl -0x3fee395b(,%eax,8),%edx
c01019cd:	c0 
c01019ce:	80 e2 ef             	and    $0xef,%dl
c01019d1:	88 14 c5 a5 c6 11 c0 	mov    %dl,-0x3fee395b(,%eax,8)
c01019d8:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01019db:	0f b6 14 c5 a5 c6 11 	movzbl -0x3fee395b(,%eax,8),%edx
c01019e2:	c0 
c01019e3:	80 e2 9f             	and    $0x9f,%dl
c01019e6:	88 14 c5 a5 c6 11 c0 	mov    %dl,-0x3fee395b(,%eax,8)
c01019ed:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01019f0:	0f b6 14 c5 a5 c6 11 	movzbl -0x3fee395b(,%eax,8),%edx
c01019f7:	c0 
c01019f8:	80 ca 80             	or     $0x80,%dl
c01019fb:	88 14 c5 a5 c6 11 c0 	mov    %dl,-0x3fee395b(,%eax,8)
c0101a02:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101a05:	8b 04 85 e0 95 11 c0 	mov    -0x3fee6a20(,%eax,4),%eax
c0101a0c:	c1 e8 10             	shr    $0x10,%eax
c0101a0f:	0f b7 d0             	movzwl %ax,%edx
c0101a12:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101a15:	66 89 14 c5 a6 c6 11 	mov    %dx,-0x3fee395a(,%eax,8)
c0101a1c:	c0 
    for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i++){
c0101a1d:	ff 45 fc             	incl   -0x4(%ebp)
c0101a20:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101a23:	3d ff 00 00 00       	cmp    $0xff,%eax
c0101a28:	0f 86 2e ff ff ff    	jbe    c010195c <idt_init+0x12>
    }
    SETGATE(idt[T_SWITCH_TOK], 0, GD_KTEXT, __vectors[T_SWITCH_TOK], DPL_USER);
c0101a2e:	a1 c4 97 11 c0       	mov    0xc01197c4,%eax
c0101a33:	0f b7 c0             	movzwl %ax,%eax
c0101a36:	66 a3 68 ca 11 c0    	mov    %ax,0xc011ca68
c0101a3c:	66 c7 05 6a ca 11 c0 	movw   $0x8,0xc011ca6a
c0101a43:	08 00 
c0101a45:	0f b6 05 6c ca 11 c0 	movzbl 0xc011ca6c,%eax
c0101a4c:	24 e0                	and    $0xe0,%al
c0101a4e:	a2 6c ca 11 c0       	mov    %al,0xc011ca6c
c0101a53:	0f b6 05 6c ca 11 c0 	movzbl 0xc011ca6c,%eax
c0101a5a:	24 1f                	and    $0x1f,%al
c0101a5c:	a2 6c ca 11 c0       	mov    %al,0xc011ca6c
c0101a61:	0f b6 05 6d ca 11 c0 	movzbl 0xc011ca6d,%eax
c0101a68:	24 f0                	and    $0xf0,%al
c0101a6a:	0c 0e                	or     $0xe,%al
c0101a6c:	a2 6d ca 11 c0       	mov    %al,0xc011ca6d
c0101a71:	0f b6 05 6d ca 11 c0 	movzbl 0xc011ca6d,%eax
c0101a78:	24 ef                	and    $0xef,%al
c0101a7a:	a2 6d ca 11 c0       	mov    %al,0xc011ca6d
c0101a7f:	0f b6 05 6d ca 11 c0 	movzbl 0xc011ca6d,%eax
c0101a86:	0c 60                	or     $0x60,%al
c0101a88:	a2 6d ca 11 c0       	mov    %al,0xc011ca6d
c0101a8d:	0f b6 05 6d ca 11 c0 	movzbl 0xc011ca6d,%eax
c0101a94:	0c 80                	or     $0x80,%al
c0101a96:	a2 6d ca 11 c0       	mov    %al,0xc011ca6d
c0101a9b:	a1 c4 97 11 c0       	mov    0xc01197c4,%eax
c0101aa0:	c1 e8 10             	shr    $0x10,%eax
c0101aa3:	0f b7 c0             	movzwl %ax,%eax
c0101aa6:	66 a3 6e ca 11 c0    	mov    %ax,0xc011ca6e
c0101aac:	c7 45 f8 60 95 11 c0 	movl   $0xc0119560,-0x8(%ebp)
    asm volatile ("lidt (%0)" :: "r" (pd) : "memory");
c0101ab3:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0101ab6:	0f 01 18             	lidtl  (%eax)
}
c0101ab9:	90                   	nop
    lidt(&idt_pd);
}
c0101aba:	90                   	nop
c0101abb:	89 ec                	mov    %ebp,%esp
c0101abd:	5d                   	pop    %ebp
c0101abe:	c3                   	ret    

c0101abf <trapname>:

static const char *
trapname(int trapno) {
c0101abf:	55                   	push   %ebp
c0101ac0:	89 e5                	mov    %esp,%ebp
        "Alignment Check",
        "Machine-Check",
        "SIMD Floating-Point Exception"
    };

    if (trapno < sizeof(excnames)/sizeof(const char * const)) {
c0101ac2:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ac5:	83 f8 13             	cmp    $0x13,%eax
c0101ac8:	77 0c                	ja     c0101ad6 <trapname+0x17>
        return excnames[trapno];
c0101aca:	8b 45 08             	mov    0x8(%ebp),%eax
c0101acd:	8b 04 85 00 67 10 c0 	mov    -0x3fef9900(,%eax,4),%eax
c0101ad4:	eb 18                	jmp    c0101aee <trapname+0x2f>
    }
    if (trapno >= IRQ_OFFSET && trapno < IRQ_OFFSET + 16) {
c0101ad6:	83 7d 08 1f          	cmpl   $0x1f,0x8(%ebp)
c0101ada:	7e 0d                	jle    c0101ae9 <trapname+0x2a>
c0101adc:	83 7d 08 2f          	cmpl   $0x2f,0x8(%ebp)
c0101ae0:	7f 07                	jg     c0101ae9 <trapname+0x2a>
        return "Hardware Interrupt";
c0101ae2:	b8 aa 63 10 c0       	mov    $0xc01063aa,%eax
c0101ae7:	eb 05                	jmp    c0101aee <trapname+0x2f>
    }
    return "(unknown trap)";
c0101ae9:	b8 bd 63 10 c0       	mov    $0xc01063bd,%eax
}
c0101aee:	5d                   	pop    %ebp
c0101aef:	c3                   	ret    

c0101af0 <trap_in_kernel>:

/* trap_in_kernel - test if trap happened in kernel */
bool
trap_in_kernel(struct trapframe *tf) {
c0101af0:	55                   	push   %ebp
c0101af1:	89 e5                	mov    %esp,%ebp
    return (tf->tf_cs == (uint16_t)KERNEL_CS);
c0101af3:	8b 45 08             	mov    0x8(%ebp),%eax
c0101af6:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101afa:	83 f8 08             	cmp    $0x8,%eax
c0101afd:	0f 94 c0             	sete   %al
c0101b00:	0f b6 c0             	movzbl %al,%eax
}
c0101b03:	5d                   	pop    %ebp
c0101b04:	c3                   	ret    

c0101b05 <print_trapframe>:
    "TF", "IF", "DF", "OF", NULL, NULL, "NT", NULL,
    "RF", "VM", "AC", "VIF", "VIP", "ID", NULL, NULL,
};

void
print_trapframe(struct trapframe *tf) {
c0101b05:	55                   	push   %ebp
c0101b06:	89 e5                	mov    %esp,%ebp
c0101b08:	83 ec 28             	sub    $0x28,%esp
    cprintf("trapframe at %p\n", tf);
c0101b0b:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b0e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101b12:	c7 04 24 fe 63 10 c0 	movl   $0xc01063fe,(%esp)
c0101b19:	e8 48 e8 ff ff       	call   c0100366 <cprintf>
    print_regs(&tf->tf_regs);
c0101b1e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b21:	89 04 24             	mov    %eax,(%esp)
c0101b24:	e8 8f 01 00 00       	call   c0101cb8 <print_regs>
    cprintf("  ds   0x----%04x\n", tf->tf_ds);
c0101b29:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b2c:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
c0101b30:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101b34:	c7 04 24 0f 64 10 c0 	movl   $0xc010640f,(%esp)
c0101b3b:	e8 26 e8 ff ff       	call   c0100366 <cprintf>
    cprintf("  es   0x----%04x\n", tf->tf_es);
c0101b40:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b43:	0f b7 40 28          	movzwl 0x28(%eax),%eax
c0101b47:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101b4b:	c7 04 24 22 64 10 c0 	movl   $0xc0106422,(%esp)
c0101b52:	e8 0f e8 ff ff       	call   c0100366 <cprintf>
    cprintf("  fs   0x----%04x\n", tf->tf_fs);
c0101b57:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b5a:	0f b7 40 24          	movzwl 0x24(%eax),%eax
c0101b5e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101b62:	c7 04 24 35 64 10 c0 	movl   $0xc0106435,(%esp)
c0101b69:	e8 f8 e7 ff ff       	call   c0100366 <cprintf>
    cprintf("  gs   0x----%04x\n", tf->tf_gs);
c0101b6e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b71:	0f b7 40 20          	movzwl 0x20(%eax),%eax
c0101b75:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101b79:	c7 04 24 48 64 10 c0 	movl   $0xc0106448,(%esp)
c0101b80:	e8 e1 e7 ff ff       	call   c0100366 <cprintf>
    cprintf("  trap 0x%08x %s\n", tf->tf_trapno, trapname(tf->tf_trapno));
c0101b85:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b88:	8b 40 30             	mov    0x30(%eax),%eax
c0101b8b:	89 04 24             	mov    %eax,(%esp)
c0101b8e:	e8 2c ff ff ff       	call   c0101abf <trapname>
c0101b93:	8b 55 08             	mov    0x8(%ebp),%edx
c0101b96:	8b 52 30             	mov    0x30(%edx),%edx
c0101b99:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101b9d:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101ba1:	c7 04 24 5b 64 10 c0 	movl   $0xc010645b,(%esp)
c0101ba8:	e8 b9 e7 ff ff       	call   c0100366 <cprintf>
    cprintf("  err  0x%08x\n", tf->tf_err);
c0101bad:	8b 45 08             	mov    0x8(%ebp),%eax
c0101bb0:	8b 40 34             	mov    0x34(%eax),%eax
c0101bb3:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101bb7:	c7 04 24 6d 64 10 c0 	movl   $0xc010646d,(%esp)
c0101bbe:	e8 a3 e7 ff ff       	call   c0100366 <cprintf>
    cprintf("  eip  0x%08x\n", tf->tf_eip);
c0101bc3:	8b 45 08             	mov    0x8(%ebp),%eax
c0101bc6:	8b 40 38             	mov    0x38(%eax),%eax
c0101bc9:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101bcd:	c7 04 24 7c 64 10 c0 	movl   $0xc010647c,(%esp)
c0101bd4:	e8 8d e7 ff ff       	call   c0100366 <cprintf>
    cprintf("  cs   0x----%04x\n", tf->tf_cs);
c0101bd9:	8b 45 08             	mov    0x8(%ebp),%eax
c0101bdc:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101be0:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101be4:	c7 04 24 8b 64 10 c0 	movl   $0xc010648b,(%esp)
c0101beb:	e8 76 e7 ff ff       	call   c0100366 <cprintf>
    cprintf("  flag 0x%08x ", tf->tf_eflags);
c0101bf0:	8b 45 08             	mov    0x8(%ebp),%eax
c0101bf3:	8b 40 40             	mov    0x40(%eax),%eax
c0101bf6:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101bfa:	c7 04 24 9e 64 10 c0 	movl   $0xc010649e,(%esp)
c0101c01:	e8 60 e7 ff ff       	call   c0100366 <cprintf>

    int i, j;
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c0101c06:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0101c0d:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
c0101c14:	eb 3d                	jmp    c0101c53 <print_trapframe+0x14e>
        if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
c0101c16:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c19:	8b 50 40             	mov    0x40(%eax),%edx
c0101c1c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101c1f:	21 d0                	and    %edx,%eax
c0101c21:	85 c0                	test   %eax,%eax
c0101c23:	74 28                	je     c0101c4d <print_trapframe+0x148>
c0101c25:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101c28:	8b 04 85 80 95 11 c0 	mov    -0x3fee6a80(,%eax,4),%eax
c0101c2f:	85 c0                	test   %eax,%eax
c0101c31:	74 1a                	je     c0101c4d <print_trapframe+0x148>
            cprintf("%s,", IA32flags[i]);
c0101c33:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101c36:	8b 04 85 80 95 11 c0 	mov    -0x3fee6a80(,%eax,4),%eax
c0101c3d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c41:	c7 04 24 ad 64 10 c0 	movl   $0xc01064ad,(%esp)
c0101c48:	e8 19 e7 ff ff       	call   c0100366 <cprintf>
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c0101c4d:	ff 45 f4             	incl   -0xc(%ebp)
c0101c50:	d1 65 f0             	shll   -0x10(%ebp)
c0101c53:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101c56:	83 f8 17             	cmp    $0x17,%eax
c0101c59:	76 bb                	jbe    c0101c16 <print_trapframe+0x111>
        }
    }
    cprintf("IOPL=%d\n", (tf->tf_eflags & FL_IOPL_MASK) >> 12);
c0101c5b:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c5e:	8b 40 40             	mov    0x40(%eax),%eax
c0101c61:	c1 e8 0c             	shr    $0xc,%eax
c0101c64:	83 e0 03             	and    $0x3,%eax
c0101c67:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c6b:	c7 04 24 b1 64 10 c0 	movl   $0xc01064b1,(%esp)
c0101c72:	e8 ef e6 ff ff       	call   c0100366 <cprintf>

    if (!trap_in_kernel(tf)) {
c0101c77:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c7a:	89 04 24             	mov    %eax,(%esp)
c0101c7d:	e8 6e fe ff ff       	call   c0101af0 <trap_in_kernel>
c0101c82:	85 c0                	test   %eax,%eax
c0101c84:	75 2d                	jne    c0101cb3 <print_trapframe+0x1ae>
        cprintf("  esp  0x%08x\n", tf->tf_esp);
c0101c86:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c89:	8b 40 44             	mov    0x44(%eax),%eax
c0101c8c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c90:	c7 04 24 ba 64 10 c0 	movl   $0xc01064ba,(%esp)
c0101c97:	e8 ca e6 ff ff       	call   c0100366 <cprintf>
        cprintf("  ss   0x----%04x\n", tf->tf_ss);
c0101c9c:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c9f:	0f b7 40 48          	movzwl 0x48(%eax),%eax
c0101ca3:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101ca7:	c7 04 24 c9 64 10 c0 	movl   $0xc01064c9,(%esp)
c0101cae:	e8 b3 e6 ff ff       	call   c0100366 <cprintf>
    }
}
c0101cb3:	90                   	nop
c0101cb4:	89 ec                	mov    %ebp,%esp
c0101cb6:	5d                   	pop    %ebp
c0101cb7:	c3                   	ret    

c0101cb8 <print_regs>:

void
print_regs(struct pushregs *regs) {
c0101cb8:	55                   	push   %ebp
c0101cb9:	89 e5                	mov    %esp,%ebp
c0101cbb:	83 ec 18             	sub    $0x18,%esp
    cprintf("  edi  0x%08x\n", regs->reg_edi);
c0101cbe:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cc1:	8b 00                	mov    (%eax),%eax
c0101cc3:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101cc7:	c7 04 24 dc 64 10 c0 	movl   $0xc01064dc,(%esp)
c0101cce:	e8 93 e6 ff ff       	call   c0100366 <cprintf>
    cprintf("  esi  0x%08x\n", regs->reg_esi);
c0101cd3:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cd6:	8b 40 04             	mov    0x4(%eax),%eax
c0101cd9:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101cdd:	c7 04 24 eb 64 10 c0 	movl   $0xc01064eb,(%esp)
c0101ce4:	e8 7d e6 ff ff       	call   c0100366 <cprintf>
    cprintf("  ebp  0x%08x\n", regs->reg_ebp);
c0101ce9:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cec:	8b 40 08             	mov    0x8(%eax),%eax
c0101cef:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101cf3:	c7 04 24 fa 64 10 c0 	movl   $0xc01064fa,(%esp)
c0101cfa:	e8 67 e6 ff ff       	call   c0100366 <cprintf>
    cprintf("  oesp 0x%08x\n", regs->reg_oesp);
c0101cff:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d02:	8b 40 0c             	mov    0xc(%eax),%eax
c0101d05:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101d09:	c7 04 24 09 65 10 c0 	movl   $0xc0106509,(%esp)
c0101d10:	e8 51 e6 ff ff       	call   c0100366 <cprintf>
    cprintf("  ebx  0x%08x\n", regs->reg_ebx);
c0101d15:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d18:	8b 40 10             	mov    0x10(%eax),%eax
c0101d1b:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101d1f:	c7 04 24 18 65 10 c0 	movl   $0xc0106518,(%esp)
c0101d26:	e8 3b e6 ff ff       	call   c0100366 <cprintf>
    cprintf("  edx  0x%08x\n", regs->reg_edx);
c0101d2b:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d2e:	8b 40 14             	mov    0x14(%eax),%eax
c0101d31:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101d35:	c7 04 24 27 65 10 c0 	movl   $0xc0106527,(%esp)
c0101d3c:	e8 25 e6 ff ff       	call   c0100366 <cprintf>
    cprintf("  ecx  0x%08x\n", regs->reg_ecx);
c0101d41:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d44:	8b 40 18             	mov    0x18(%eax),%eax
c0101d47:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101d4b:	c7 04 24 36 65 10 c0 	movl   $0xc0106536,(%esp)
c0101d52:	e8 0f e6 ff ff       	call   c0100366 <cprintf>
    cprintf("  eax  0x%08x\n", regs->reg_eax);
c0101d57:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d5a:	8b 40 1c             	mov    0x1c(%eax),%eax
c0101d5d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101d61:	c7 04 24 45 65 10 c0 	movl   $0xc0106545,(%esp)
c0101d68:	e8 f9 e5 ff ff       	call   c0100366 <cprintf>
}
c0101d6d:	90                   	nop
c0101d6e:	89 ec                	mov    %ebp,%esp
c0101d70:	5d                   	pop    %ebp
c0101d71:	c3                   	ret    

c0101d72 <trap_dispatch>:

struct trapframe *switchu2k;

/* trap_dispatch - dispatch based on what type of trap occurred */
static void
trap_dispatch(struct trapframe *tf) {
c0101d72:	55                   	push   %ebp
c0101d73:	89 e5                	mov    %esp,%ebp
c0101d75:	83 ec 28             	sub    $0x28,%esp
    char c;
    static tickcount = 0;
    static tickcount1 = 0;
    switch (tf->tf_trapno) {
c0101d78:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d7b:	8b 40 30             	mov    0x30(%eax),%eax
c0101d7e:	83 f8 79             	cmp    $0x79,%eax
c0101d81:	0f 84 2f 02 00 00    	je     c0101fb6 <trap_dispatch+0x244>
c0101d87:	83 f8 79             	cmp    $0x79,%eax
c0101d8a:	0f 87 67 02 00 00    	ja     c0101ff7 <trap_dispatch+0x285>
c0101d90:	83 f8 78             	cmp    $0x78,%eax
c0101d93:	0f 84 c7 01 00 00    	je     c0101f60 <trap_dispatch+0x1ee>
c0101d99:	83 f8 78             	cmp    $0x78,%eax
c0101d9c:	0f 87 55 02 00 00    	ja     c0101ff7 <trap_dispatch+0x285>
c0101da2:	83 f8 2f             	cmp    $0x2f,%eax
c0101da5:	0f 87 4c 02 00 00    	ja     c0101ff7 <trap_dispatch+0x285>
c0101dab:	83 f8 2e             	cmp    $0x2e,%eax
c0101dae:	0f 83 78 02 00 00    	jae    c010202c <trap_dispatch+0x2ba>
c0101db4:	83 f8 24             	cmp    $0x24,%eax
c0101db7:	74 45                	je     c0101dfe <trap_dispatch+0x8c>
c0101db9:	83 f8 24             	cmp    $0x24,%eax
c0101dbc:	0f 87 35 02 00 00    	ja     c0101ff7 <trap_dispatch+0x285>
c0101dc2:	83 f8 20             	cmp    $0x20,%eax
c0101dc5:	74 0a                	je     c0101dd1 <trap_dispatch+0x5f>
c0101dc7:	83 f8 21             	cmp    $0x21,%eax
c0101dca:	74 5b                	je     c0101e27 <trap_dispatch+0xb5>
c0101dcc:	e9 26 02 00 00       	jmp    c0101ff7 <trap_dispatch+0x285>
        /* handle the timer interrupt */
        /* (1) After a timer interrupt, you should record this event using a global variable (increase it), such as ticks in kern/driver/clock.c
         * (2) Every TICK_NUM cycle, you can print some info using a funciton, such as print_ticks().
         * (3) Too Simple? Yes, I think so!
         */
        tickcount+=1;
c0101dd1:	a1 a0 ce 11 c0       	mov    0xc011cea0,%eax
c0101dd6:	40                   	inc    %eax
c0101dd7:	a3 a0 ce 11 c0       	mov    %eax,0xc011cea0
        if(tickcount==TICK_NUM){
c0101ddc:	a1 a0 ce 11 c0       	mov    0xc011cea0,%eax
c0101de1:	83 f8 64             	cmp    $0x64,%eax
c0101de4:	0f 85 45 02 00 00    	jne    c010202f <trap_dispatch+0x2bd>
            tickcount = 0;
c0101dea:	c7 05 a0 ce 11 c0 00 	movl   $0x0,0xc011cea0
c0101df1:	00 00 00 
            print_ticks();
c0101df4:	e8 32 fb ff ff       	call   c010192b <print_ticks>
        }
        break;
c0101df9:	e9 31 02 00 00       	jmp    c010202f <trap_dispatch+0x2bd>
    case IRQ_OFFSET + IRQ_COM1:
        c = cons_getc();
c0101dfe:	e8 cb f8 ff ff       	call   c01016ce <cons_getc>
c0101e03:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("serial [%03d] %c\n", c, c);
c0101e06:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
c0101e0a:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0101e0e:	89 54 24 08          	mov    %edx,0x8(%esp)
c0101e12:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101e16:	c7 04 24 54 65 10 c0 	movl   $0xc0106554,(%esp)
c0101e1d:	e8 44 e5 ff ff       	call   c0100366 <cprintf>
        break;
c0101e22:	e9 15 02 00 00       	jmp    c010203c <trap_dispatch+0x2ca>
    case IRQ_OFFSET + IRQ_KBD:
        c = cons_getc();
c0101e27:	e8 a2 f8 ff ff       	call   c01016ce <cons_getc>
c0101e2c:	88 45 f7             	mov    %al,-0x9(%ebp)
        // cprintf("kbd [%03d] %c\n", c, c);
        // break;
        
        if(c == '3'){
c0101e2f:	80 7d f7 33          	cmpb   $0x33,-0x9(%ebp)
c0101e33:	75 62                	jne    c0101e97 <trap_dispatch+0x125>
            //     "movl %%ebp, %%esp"
            //     :
            //     : "i"(T_SWITCH_TOU)
            // );
            // break;
            if (tf->tf_cs != USER_CS) {
c0101e35:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e38:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101e3c:	83 f8 1b             	cmp    $0x1b,%eax
c0101e3f:	0f 84 ed 01 00 00    	je     c0102032 <trap_dispatch+0x2c0>
                tf->tf_cs = USER_CS;
c0101e45:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e48:	66 c7 40 3c 1b 00    	movw   $0x1b,0x3c(%eax)
                tf->tf_ds = tf->tf_es = tf->tf_ss = USER_DS;
c0101e4e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e51:	66 c7 40 48 23 00    	movw   $0x23,0x48(%eax)
c0101e57:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e5a:	0f b7 50 48          	movzwl 0x48(%eax),%edx
c0101e5e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e61:	66 89 50 28          	mov    %dx,0x28(%eax)
c0101e65:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e68:	0f b7 50 28          	movzwl 0x28(%eax),%edx
c0101e6c:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e6f:	66 89 50 2c          	mov    %dx,0x2c(%eax)
                tf->tf_eflags |= FL_IOPL_MASK;
c0101e73:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e76:	8b 40 40             	mov    0x40(%eax),%eax
c0101e79:	0d 00 30 00 00       	or     $0x3000,%eax
c0101e7e:	89 c2                	mov    %eax,%edx
c0101e80:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e83:	89 50 40             	mov    %edx,0x40(%eax)
                tf->tf_esp = (uint32_t)tf + sizeof(struct trapframe) - 8;
c0101e86:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e89:	8d 50 44             	lea    0x44(%eax),%edx
c0101e8c:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e8f:	89 50 44             	mov    %edx,0x44(%eax)
            }
            break;
c0101e92:	e9 9b 01 00 00       	jmp    c0102032 <trap_dispatch+0x2c0>

        }
        else if(c == '0'){
c0101e97:	80 7d f7 30          	cmpb   $0x30,-0x9(%ebp)
c0101e9b:	0f 85 80 00 00 00    	jne    c0101f21 <trap_dispatch+0x1af>
            //     "int %0 \n"
            //     "movl %%ebp, %%esp \n"
            //     :
            //     : "i"(T_SWITCH_TOK)
            // );
            if (tf->tf_cs != KERNEL_CS) {
c0101ea1:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ea4:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101ea8:	83 f8 08             	cmp    $0x8,%eax
c0101eab:	0f 84 84 01 00 00    	je     c0102035 <trap_dispatch+0x2c3>
                tf->tf_cs = KERNEL_CS;
c0101eb1:	8b 45 08             	mov    0x8(%ebp),%eax
c0101eb4:	66 c7 40 3c 08 00    	movw   $0x8,0x3c(%eax)
                tf->tf_ds = tf->tf_es = KERNEL_DS;
c0101eba:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ebd:	66 c7 40 28 10 00    	movw   $0x10,0x28(%eax)
c0101ec3:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ec6:	0f b7 50 28          	movzwl 0x28(%eax),%edx
c0101eca:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ecd:	66 89 50 2c          	mov    %dx,0x2c(%eax)
                tf->tf_eflags &= ~FL_IOPL_MASK;
c0101ed1:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ed4:	8b 40 40             	mov    0x40(%eax),%eax
c0101ed7:	25 ff cf ff ff       	and    $0xffffcfff,%eax
c0101edc:	89 c2                	mov    %eax,%edx
c0101ede:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ee1:	89 50 40             	mov    %edx,0x40(%eax)
                switchu2k = (struct trapframe *)(tf->tf_esp - (sizeof(struct trapframe) - 8));
c0101ee4:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ee7:	8b 40 44             	mov    0x44(%eax),%eax
c0101eea:	83 e8 44             	sub    $0x44,%eax
c0101eed:	a3 80 c6 11 c0       	mov    %eax,0xc011c680
                memmove(switchu2k, tf, sizeof(struct trapframe) - 8);
c0101ef2:	a1 80 c6 11 c0       	mov    0xc011c680,%eax
c0101ef7:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
c0101efe:	00 
c0101eff:	8b 55 08             	mov    0x8(%ebp),%edx
c0101f02:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101f06:	89 04 24             	mov    %eax,(%esp)
c0101f09:	e8 dd 3f 00 00       	call   c0105eeb <memmove>
                *((uint32_t *)tf - 1) = (uint32_t)switchu2k;
c0101f0e:	8b 15 80 c6 11 c0    	mov    0xc011c680,%edx
c0101f14:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f17:	83 e8 04             	sub    $0x4,%eax
c0101f1a:	89 10                	mov    %edx,(%eax)
            }
            break;
c0101f1c:	e9 14 01 00 00       	jmp    c0102035 <trap_dispatch+0x2c3>
        }else if(c == 'p'){
c0101f21:	80 7d f7 70          	cmpb   $0x70,-0x9(%ebp)
c0101f25:	75 18                	jne    c0101f3f <trap_dispatch+0x1cd>
            cprintf("trapframe at %p\n", tf); 
c0101f27:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f2a:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101f2e:	c7 04 24 fe 63 10 c0 	movl   $0xc01063fe,(%esp)
c0101f35:	e8 2c e4 ff ff       	call   c0100366 <cprintf>
            break;
c0101f3a:	e9 fd 00 00 00       	jmp    c010203c <trap_dispatch+0x2ca>
        }else{
            cprintf("kbd [%03d] %c\n", c, c);
c0101f3f:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
c0101f43:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0101f47:	89 54 24 08          	mov    %edx,0x8(%esp)
c0101f4b:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101f4f:	c7 04 24 66 65 10 c0 	movl   $0xc0106566,(%esp)
c0101f56:	e8 0b e4 ff ff       	call   c0100366 <cprintf>
            break;
c0101f5b:	e9 dc 00 00 00       	jmp    c010203c <trap_dispatch+0x2ca>
        }
    //LAB1 CHALLENGE 1 : YOUR CODE you should modify below codes.
    case T_SWITCH_TOU:
        if (tf->tf_cs != USER_CS) {
c0101f60:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f63:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101f67:	83 f8 1b             	cmp    $0x1b,%eax
c0101f6a:	0f 84 c8 00 00 00    	je     c0102038 <trap_dispatch+0x2c6>
            tf->tf_cs = USER_CS;
c0101f70:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f73:	66 c7 40 3c 1b 00    	movw   $0x1b,0x3c(%eax)
            tf->tf_ds = tf->tf_es = tf->tf_ss = USER_DS;
c0101f79:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f7c:	66 c7 40 48 23 00    	movw   $0x23,0x48(%eax)
c0101f82:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f85:	0f b7 50 48          	movzwl 0x48(%eax),%edx
c0101f89:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f8c:	66 89 50 28          	mov    %dx,0x28(%eax)
c0101f90:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f93:	0f b7 50 28          	movzwl 0x28(%eax),%edx
c0101f97:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f9a:	66 89 50 2c          	mov    %dx,0x2c(%eax)
            tf->tf_eflags |= FL_IOPL_MASK;
c0101f9e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fa1:	8b 40 40             	mov    0x40(%eax),%eax
c0101fa4:	0d 00 30 00 00       	or     $0x3000,%eax
c0101fa9:	89 c2                	mov    %eax,%edx
c0101fab:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fae:	89 50 40             	mov    %edx,0x40(%eax)
        }
        break;
c0101fb1:	e9 82 00 00 00       	jmp    c0102038 <trap_dispatch+0x2c6>
    case T_SWITCH_TOK:
        if (tf->tf_cs != KERNEL_CS) {
c0101fb6:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fb9:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101fbd:	83 f8 08             	cmp    $0x8,%eax
c0101fc0:	74 79                	je     c010203b <trap_dispatch+0x2c9>
        tf->tf_cs = KERNEL_CS;
c0101fc2:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fc5:	66 c7 40 3c 08 00    	movw   $0x8,0x3c(%eax)
        tf->tf_ds = tf->tf_es = KERNEL_DS;
c0101fcb:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fce:	66 c7 40 28 10 00    	movw   $0x10,0x28(%eax)
c0101fd4:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fd7:	0f b7 50 28          	movzwl 0x28(%eax),%edx
c0101fdb:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fde:	66 89 50 2c          	mov    %dx,0x2c(%eax)
        tf->tf_eflags &= ~FL_IOPL_MASK;
c0101fe2:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fe5:	8b 40 40             	mov    0x40(%eax),%eax
c0101fe8:	25 ff cf ff ff       	and    $0xffffcfff,%eax
c0101fed:	89 c2                	mov    %eax,%edx
c0101fef:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ff2:	89 50 40             	mov    %edx,0x40(%eax)
        }
        break;
c0101ff5:	eb 44                	jmp    c010203b <trap_dispatch+0x2c9>
    case IRQ_OFFSET + IRQ_IDE2:
        /* do nothing */
        break;
    default:
        // in kernel, it must be a mistake
        if ((tf->tf_cs & 3) == 0) {
c0101ff7:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ffa:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101ffe:	83 e0 03             	and    $0x3,%eax
c0102001:	85 c0                	test   %eax,%eax
c0102003:	75 37                	jne    c010203c <trap_dispatch+0x2ca>
            print_trapframe(tf);
c0102005:	8b 45 08             	mov    0x8(%ebp),%eax
c0102008:	89 04 24             	mov    %eax,(%esp)
c010200b:	e8 f5 fa ff ff       	call   c0101b05 <print_trapframe>
            panic("unexpected trap in kernel.\n");
c0102010:	c7 44 24 08 75 65 10 	movl   $0xc0106575,0x8(%esp)
c0102017:	c0 
c0102018:	c7 44 24 04 f3 00 00 	movl   $0xf3,0x4(%esp)
c010201f:	00 
c0102020:	c7 04 24 91 65 10 c0 	movl   $0xc0106591,(%esp)
c0102027:	e8 c2 ec ff ff       	call   c0100cee <__panic>
        break;
c010202c:	90                   	nop
c010202d:	eb 0d                	jmp    c010203c <trap_dispatch+0x2ca>
        break;
c010202f:	90                   	nop
c0102030:	eb 0a                	jmp    c010203c <trap_dispatch+0x2ca>
            break;
c0102032:	90                   	nop
c0102033:	eb 07                	jmp    c010203c <trap_dispatch+0x2ca>
            break;
c0102035:	90                   	nop
c0102036:	eb 04                	jmp    c010203c <trap_dispatch+0x2ca>
        break;
c0102038:	90                   	nop
c0102039:	eb 01                	jmp    c010203c <trap_dispatch+0x2ca>
        break;
c010203b:	90                   	nop
        }
    }
}
c010203c:	90                   	nop
c010203d:	89 ec                	mov    %ebp,%esp
c010203f:	5d                   	pop    %ebp
c0102040:	c3                   	ret    

c0102041 <trap>:
 * trap - handles or dispatches an exception/interrupt. if and when trap() returns,
 * the code in kern/trap/trapentry.S restores the old CPU state saved in the
 * trapframe and then uses the iret instruction to return from the exception.
 * */
void
trap(struct trapframe *tf) {
c0102041:	55                   	push   %ebp
c0102042:	89 e5                	mov    %esp,%ebp
c0102044:	83 ec 18             	sub    $0x18,%esp
    // dispatch based on what type of trap occurred
    trap_dispatch(tf);
c0102047:	8b 45 08             	mov    0x8(%ebp),%eax
c010204a:	89 04 24             	mov    %eax,(%esp)
c010204d:	e8 20 fd ff ff       	call   c0101d72 <trap_dispatch>
}
c0102052:	90                   	nop
c0102053:	89 ec                	mov    %ebp,%esp
c0102055:	5d                   	pop    %ebp
c0102056:	c3                   	ret    

c0102057 <__alltraps>:
.text
.globl __alltraps
__alltraps:
    # push registers to build a trap frame
    # therefore make the stack look like a struct trapframe
    pushl %ds
c0102057:	1e                   	push   %ds
    pushl %es
c0102058:	06                   	push   %es
    pushl %fs
c0102059:	0f a0                	push   %fs
    pushl %gs
c010205b:	0f a8                	push   %gs
    pushal
c010205d:	60                   	pusha  

    # load GD_KDATA into %ds and %es to set up data segments for kernel
    movl $GD_KDATA, %eax
c010205e:	b8 10 00 00 00       	mov    $0x10,%eax
    movw %ax, %ds
c0102063:	8e d8                	mov    %eax,%ds
    movw %ax, %es
c0102065:	8e c0                	mov    %eax,%es

    # push %esp to pass a pointer to the trapframe as an argument to trap()
    pushl %esp
c0102067:	54                   	push   %esp

    # call trap(tf), where tf=%esp
    call trap
c0102068:	e8 d4 ff ff ff       	call   c0102041 <trap>

    # pop the pushed stack pointer
    popl %esp
c010206d:	5c                   	pop    %esp

c010206e <__trapret>:

    # return falls through to trapret...
.globl __trapret
__trapret:
    # restore registers from stack
    popal
c010206e:	61                   	popa   

    # restore %ds, %es, %fs and %gs
    popl %gs
c010206f:	0f a9                	pop    %gs
    popl %fs
c0102071:	0f a1                	pop    %fs
    popl %es
c0102073:	07                   	pop    %es
    popl %ds
c0102074:	1f                   	pop    %ds

    # get rid of the trap number and error code
    addl $0x8, %esp
c0102075:	83 c4 08             	add    $0x8,%esp
    iret
c0102078:	cf                   	iret   

c0102079 <vector0>:
# handler
.text
.globl __alltraps
.globl vector0
vector0:
  pushl $0
c0102079:	6a 00                	push   $0x0
  pushl $0
c010207b:	6a 00                	push   $0x0
  jmp __alltraps
c010207d:	e9 d5 ff ff ff       	jmp    c0102057 <__alltraps>

c0102082 <vector1>:
.globl vector1
vector1:
  pushl $0
c0102082:	6a 00                	push   $0x0
  pushl $1
c0102084:	6a 01                	push   $0x1
  jmp __alltraps
c0102086:	e9 cc ff ff ff       	jmp    c0102057 <__alltraps>

c010208b <vector2>:
.globl vector2
vector2:
  pushl $0
c010208b:	6a 00                	push   $0x0
  pushl $2
c010208d:	6a 02                	push   $0x2
  jmp __alltraps
c010208f:	e9 c3 ff ff ff       	jmp    c0102057 <__alltraps>

c0102094 <vector3>:
.globl vector3
vector3:
  pushl $0
c0102094:	6a 00                	push   $0x0
  pushl $3
c0102096:	6a 03                	push   $0x3
  jmp __alltraps
c0102098:	e9 ba ff ff ff       	jmp    c0102057 <__alltraps>

c010209d <vector4>:
.globl vector4
vector4:
  pushl $0
c010209d:	6a 00                	push   $0x0
  pushl $4
c010209f:	6a 04                	push   $0x4
  jmp __alltraps
c01020a1:	e9 b1 ff ff ff       	jmp    c0102057 <__alltraps>

c01020a6 <vector5>:
.globl vector5
vector5:
  pushl $0
c01020a6:	6a 00                	push   $0x0
  pushl $5
c01020a8:	6a 05                	push   $0x5
  jmp __alltraps
c01020aa:	e9 a8 ff ff ff       	jmp    c0102057 <__alltraps>

c01020af <vector6>:
.globl vector6
vector6:
  pushl $0
c01020af:	6a 00                	push   $0x0
  pushl $6
c01020b1:	6a 06                	push   $0x6
  jmp __alltraps
c01020b3:	e9 9f ff ff ff       	jmp    c0102057 <__alltraps>

c01020b8 <vector7>:
.globl vector7
vector7:
  pushl $0
c01020b8:	6a 00                	push   $0x0
  pushl $7
c01020ba:	6a 07                	push   $0x7
  jmp __alltraps
c01020bc:	e9 96 ff ff ff       	jmp    c0102057 <__alltraps>

c01020c1 <vector8>:
.globl vector8
vector8:
  pushl $8
c01020c1:	6a 08                	push   $0x8
  jmp __alltraps
c01020c3:	e9 8f ff ff ff       	jmp    c0102057 <__alltraps>

c01020c8 <vector9>:
.globl vector9
vector9:
  pushl $0
c01020c8:	6a 00                	push   $0x0
  pushl $9
c01020ca:	6a 09                	push   $0x9
  jmp __alltraps
c01020cc:	e9 86 ff ff ff       	jmp    c0102057 <__alltraps>

c01020d1 <vector10>:
.globl vector10
vector10:
  pushl $10
c01020d1:	6a 0a                	push   $0xa
  jmp __alltraps
c01020d3:	e9 7f ff ff ff       	jmp    c0102057 <__alltraps>

c01020d8 <vector11>:
.globl vector11
vector11:
  pushl $11
c01020d8:	6a 0b                	push   $0xb
  jmp __alltraps
c01020da:	e9 78 ff ff ff       	jmp    c0102057 <__alltraps>

c01020df <vector12>:
.globl vector12
vector12:
  pushl $12
c01020df:	6a 0c                	push   $0xc
  jmp __alltraps
c01020e1:	e9 71 ff ff ff       	jmp    c0102057 <__alltraps>

c01020e6 <vector13>:
.globl vector13
vector13:
  pushl $13
c01020e6:	6a 0d                	push   $0xd
  jmp __alltraps
c01020e8:	e9 6a ff ff ff       	jmp    c0102057 <__alltraps>

c01020ed <vector14>:
.globl vector14
vector14:
  pushl $14
c01020ed:	6a 0e                	push   $0xe
  jmp __alltraps
c01020ef:	e9 63 ff ff ff       	jmp    c0102057 <__alltraps>

c01020f4 <vector15>:
.globl vector15
vector15:
  pushl $0
c01020f4:	6a 00                	push   $0x0
  pushl $15
c01020f6:	6a 0f                	push   $0xf
  jmp __alltraps
c01020f8:	e9 5a ff ff ff       	jmp    c0102057 <__alltraps>

c01020fd <vector16>:
.globl vector16
vector16:
  pushl $0
c01020fd:	6a 00                	push   $0x0
  pushl $16
c01020ff:	6a 10                	push   $0x10
  jmp __alltraps
c0102101:	e9 51 ff ff ff       	jmp    c0102057 <__alltraps>

c0102106 <vector17>:
.globl vector17
vector17:
  pushl $17
c0102106:	6a 11                	push   $0x11
  jmp __alltraps
c0102108:	e9 4a ff ff ff       	jmp    c0102057 <__alltraps>

c010210d <vector18>:
.globl vector18
vector18:
  pushl $0
c010210d:	6a 00                	push   $0x0
  pushl $18
c010210f:	6a 12                	push   $0x12
  jmp __alltraps
c0102111:	e9 41 ff ff ff       	jmp    c0102057 <__alltraps>

c0102116 <vector19>:
.globl vector19
vector19:
  pushl $0
c0102116:	6a 00                	push   $0x0
  pushl $19
c0102118:	6a 13                	push   $0x13
  jmp __alltraps
c010211a:	e9 38 ff ff ff       	jmp    c0102057 <__alltraps>

c010211f <vector20>:
.globl vector20
vector20:
  pushl $0
c010211f:	6a 00                	push   $0x0
  pushl $20
c0102121:	6a 14                	push   $0x14
  jmp __alltraps
c0102123:	e9 2f ff ff ff       	jmp    c0102057 <__alltraps>

c0102128 <vector21>:
.globl vector21
vector21:
  pushl $0
c0102128:	6a 00                	push   $0x0
  pushl $21
c010212a:	6a 15                	push   $0x15
  jmp __alltraps
c010212c:	e9 26 ff ff ff       	jmp    c0102057 <__alltraps>

c0102131 <vector22>:
.globl vector22
vector22:
  pushl $0
c0102131:	6a 00                	push   $0x0
  pushl $22
c0102133:	6a 16                	push   $0x16
  jmp __alltraps
c0102135:	e9 1d ff ff ff       	jmp    c0102057 <__alltraps>

c010213a <vector23>:
.globl vector23
vector23:
  pushl $0
c010213a:	6a 00                	push   $0x0
  pushl $23
c010213c:	6a 17                	push   $0x17
  jmp __alltraps
c010213e:	e9 14 ff ff ff       	jmp    c0102057 <__alltraps>

c0102143 <vector24>:
.globl vector24
vector24:
  pushl $0
c0102143:	6a 00                	push   $0x0
  pushl $24
c0102145:	6a 18                	push   $0x18
  jmp __alltraps
c0102147:	e9 0b ff ff ff       	jmp    c0102057 <__alltraps>

c010214c <vector25>:
.globl vector25
vector25:
  pushl $0
c010214c:	6a 00                	push   $0x0
  pushl $25
c010214e:	6a 19                	push   $0x19
  jmp __alltraps
c0102150:	e9 02 ff ff ff       	jmp    c0102057 <__alltraps>

c0102155 <vector26>:
.globl vector26
vector26:
  pushl $0
c0102155:	6a 00                	push   $0x0
  pushl $26
c0102157:	6a 1a                	push   $0x1a
  jmp __alltraps
c0102159:	e9 f9 fe ff ff       	jmp    c0102057 <__alltraps>

c010215e <vector27>:
.globl vector27
vector27:
  pushl $0
c010215e:	6a 00                	push   $0x0
  pushl $27
c0102160:	6a 1b                	push   $0x1b
  jmp __alltraps
c0102162:	e9 f0 fe ff ff       	jmp    c0102057 <__alltraps>

c0102167 <vector28>:
.globl vector28
vector28:
  pushl $0
c0102167:	6a 00                	push   $0x0
  pushl $28
c0102169:	6a 1c                	push   $0x1c
  jmp __alltraps
c010216b:	e9 e7 fe ff ff       	jmp    c0102057 <__alltraps>

c0102170 <vector29>:
.globl vector29
vector29:
  pushl $0
c0102170:	6a 00                	push   $0x0
  pushl $29
c0102172:	6a 1d                	push   $0x1d
  jmp __alltraps
c0102174:	e9 de fe ff ff       	jmp    c0102057 <__alltraps>

c0102179 <vector30>:
.globl vector30
vector30:
  pushl $0
c0102179:	6a 00                	push   $0x0
  pushl $30
c010217b:	6a 1e                	push   $0x1e
  jmp __alltraps
c010217d:	e9 d5 fe ff ff       	jmp    c0102057 <__alltraps>

c0102182 <vector31>:
.globl vector31
vector31:
  pushl $0
c0102182:	6a 00                	push   $0x0
  pushl $31
c0102184:	6a 1f                	push   $0x1f
  jmp __alltraps
c0102186:	e9 cc fe ff ff       	jmp    c0102057 <__alltraps>

c010218b <vector32>:
.globl vector32
vector32:
  pushl $0
c010218b:	6a 00                	push   $0x0
  pushl $32
c010218d:	6a 20                	push   $0x20
  jmp __alltraps
c010218f:	e9 c3 fe ff ff       	jmp    c0102057 <__alltraps>

c0102194 <vector33>:
.globl vector33
vector33:
  pushl $0
c0102194:	6a 00                	push   $0x0
  pushl $33
c0102196:	6a 21                	push   $0x21
  jmp __alltraps
c0102198:	e9 ba fe ff ff       	jmp    c0102057 <__alltraps>

c010219d <vector34>:
.globl vector34
vector34:
  pushl $0
c010219d:	6a 00                	push   $0x0
  pushl $34
c010219f:	6a 22                	push   $0x22
  jmp __alltraps
c01021a1:	e9 b1 fe ff ff       	jmp    c0102057 <__alltraps>

c01021a6 <vector35>:
.globl vector35
vector35:
  pushl $0
c01021a6:	6a 00                	push   $0x0
  pushl $35
c01021a8:	6a 23                	push   $0x23
  jmp __alltraps
c01021aa:	e9 a8 fe ff ff       	jmp    c0102057 <__alltraps>

c01021af <vector36>:
.globl vector36
vector36:
  pushl $0
c01021af:	6a 00                	push   $0x0
  pushl $36
c01021b1:	6a 24                	push   $0x24
  jmp __alltraps
c01021b3:	e9 9f fe ff ff       	jmp    c0102057 <__alltraps>

c01021b8 <vector37>:
.globl vector37
vector37:
  pushl $0
c01021b8:	6a 00                	push   $0x0
  pushl $37
c01021ba:	6a 25                	push   $0x25
  jmp __alltraps
c01021bc:	e9 96 fe ff ff       	jmp    c0102057 <__alltraps>

c01021c1 <vector38>:
.globl vector38
vector38:
  pushl $0
c01021c1:	6a 00                	push   $0x0
  pushl $38
c01021c3:	6a 26                	push   $0x26
  jmp __alltraps
c01021c5:	e9 8d fe ff ff       	jmp    c0102057 <__alltraps>

c01021ca <vector39>:
.globl vector39
vector39:
  pushl $0
c01021ca:	6a 00                	push   $0x0
  pushl $39
c01021cc:	6a 27                	push   $0x27
  jmp __alltraps
c01021ce:	e9 84 fe ff ff       	jmp    c0102057 <__alltraps>

c01021d3 <vector40>:
.globl vector40
vector40:
  pushl $0
c01021d3:	6a 00                	push   $0x0
  pushl $40
c01021d5:	6a 28                	push   $0x28
  jmp __alltraps
c01021d7:	e9 7b fe ff ff       	jmp    c0102057 <__alltraps>

c01021dc <vector41>:
.globl vector41
vector41:
  pushl $0
c01021dc:	6a 00                	push   $0x0
  pushl $41
c01021de:	6a 29                	push   $0x29
  jmp __alltraps
c01021e0:	e9 72 fe ff ff       	jmp    c0102057 <__alltraps>

c01021e5 <vector42>:
.globl vector42
vector42:
  pushl $0
c01021e5:	6a 00                	push   $0x0
  pushl $42
c01021e7:	6a 2a                	push   $0x2a
  jmp __alltraps
c01021e9:	e9 69 fe ff ff       	jmp    c0102057 <__alltraps>

c01021ee <vector43>:
.globl vector43
vector43:
  pushl $0
c01021ee:	6a 00                	push   $0x0
  pushl $43
c01021f0:	6a 2b                	push   $0x2b
  jmp __alltraps
c01021f2:	e9 60 fe ff ff       	jmp    c0102057 <__alltraps>

c01021f7 <vector44>:
.globl vector44
vector44:
  pushl $0
c01021f7:	6a 00                	push   $0x0
  pushl $44
c01021f9:	6a 2c                	push   $0x2c
  jmp __alltraps
c01021fb:	e9 57 fe ff ff       	jmp    c0102057 <__alltraps>

c0102200 <vector45>:
.globl vector45
vector45:
  pushl $0
c0102200:	6a 00                	push   $0x0
  pushl $45
c0102202:	6a 2d                	push   $0x2d
  jmp __alltraps
c0102204:	e9 4e fe ff ff       	jmp    c0102057 <__alltraps>

c0102209 <vector46>:
.globl vector46
vector46:
  pushl $0
c0102209:	6a 00                	push   $0x0
  pushl $46
c010220b:	6a 2e                	push   $0x2e
  jmp __alltraps
c010220d:	e9 45 fe ff ff       	jmp    c0102057 <__alltraps>

c0102212 <vector47>:
.globl vector47
vector47:
  pushl $0
c0102212:	6a 00                	push   $0x0
  pushl $47
c0102214:	6a 2f                	push   $0x2f
  jmp __alltraps
c0102216:	e9 3c fe ff ff       	jmp    c0102057 <__alltraps>

c010221b <vector48>:
.globl vector48
vector48:
  pushl $0
c010221b:	6a 00                	push   $0x0
  pushl $48
c010221d:	6a 30                	push   $0x30
  jmp __alltraps
c010221f:	e9 33 fe ff ff       	jmp    c0102057 <__alltraps>

c0102224 <vector49>:
.globl vector49
vector49:
  pushl $0
c0102224:	6a 00                	push   $0x0
  pushl $49
c0102226:	6a 31                	push   $0x31
  jmp __alltraps
c0102228:	e9 2a fe ff ff       	jmp    c0102057 <__alltraps>

c010222d <vector50>:
.globl vector50
vector50:
  pushl $0
c010222d:	6a 00                	push   $0x0
  pushl $50
c010222f:	6a 32                	push   $0x32
  jmp __alltraps
c0102231:	e9 21 fe ff ff       	jmp    c0102057 <__alltraps>

c0102236 <vector51>:
.globl vector51
vector51:
  pushl $0
c0102236:	6a 00                	push   $0x0
  pushl $51
c0102238:	6a 33                	push   $0x33
  jmp __alltraps
c010223a:	e9 18 fe ff ff       	jmp    c0102057 <__alltraps>

c010223f <vector52>:
.globl vector52
vector52:
  pushl $0
c010223f:	6a 00                	push   $0x0
  pushl $52
c0102241:	6a 34                	push   $0x34
  jmp __alltraps
c0102243:	e9 0f fe ff ff       	jmp    c0102057 <__alltraps>

c0102248 <vector53>:
.globl vector53
vector53:
  pushl $0
c0102248:	6a 00                	push   $0x0
  pushl $53
c010224a:	6a 35                	push   $0x35
  jmp __alltraps
c010224c:	e9 06 fe ff ff       	jmp    c0102057 <__alltraps>

c0102251 <vector54>:
.globl vector54
vector54:
  pushl $0
c0102251:	6a 00                	push   $0x0
  pushl $54
c0102253:	6a 36                	push   $0x36
  jmp __alltraps
c0102255:	e9 fd fd ff ff       	jmp    c0102057 <__alltraps>

c010225a <vector55>:
.globl vector55
vector55:
  pushl $0
c010225a:	6a 00                	push   $0x0
  pushl $55
c010225c:	6a 37                	push   $0x37
  jmp __alltraps
c010225e:	e9 f4 fd ff ff       	jmp    c0102057 <__alltraps>

c0102263 <vector56>:
.globl vector56
vector56:
  pushl $0
c0102263:	6a 00                	push   $0x0
  pushl $56
c0102265:	6a 38                	push   $0x38
  jmp __alltraps
c0102267:	e9 eb fd ff ff       	jmp    c0102057 <__alltraps>

c010226c <vector57>:
.globl vector57
vector57:
  pushl $0
c010226c:	6a 00                	push   $0x0
  pushl $57
c010226e:	6a 39                	push   $0x39
  jmp __alltraps
c0102270:	e9 e2 fd ff ff       	jmp    c0102057 <__alltraps>

c0102275 <vector58>:
.globl vector58
vector58:
  pushl $0
c0102275:	6a 00                	push   $0x0
  pushl $58
c0102277:	6a 3a                	push   $0x3a
  jmp __alltraps
c0102279:	e9 d9 fd ff ff       	jmp    c0102057 <__alltraps>

c010227e <vector59>:
.globl vector59
vector59:
  pushl $0
c010227e:	6a 00                	push   $0x0
  pushl $59
c0102280:	6a 3b                	push   $0x3b
  jmp __alltraps
c0102282:	e9 d0 fd ff ff       	jmp    c0102057 <__alltraps>

c0102287 <vector60>:
.globl vector60
vector60:
  pushl $0
c0102287:	6a 00                	push   $0x0
  pushl $60
c0102289:	6a 3c                	push   $0x3c
  jmp __alltraps
c010228b:	e9 c7 fd ff ff       	jmp    c0102057 <__alltraps>

c0102290 <vector61>:
.globl vector61
vector61:
  pushl $0
c0102290:	6a 00                	push   $0x0
  pushl $61
c0102292:	6a 3d                	push   $0x3d
  jmp __alltraps
c0102294:	e9 be fd ff ff       	jmp    c0102057 <__alltraps>

c0102299 <vector62>:
.globl vector62
vector62:
  pushl $0
c0102299:	6a 00                	push   $0x0
  pushl $62
c010229b:	6a 3e                	push   $0x3e
  jmp __alltraps
c010229d:	e9 b5 fd ff ff       	jmp    c0102057 <__alltraps>

c01022a2 <vector63>:
.globl vector63
vector63:
  pushl $0
c01022a2:	6a 00                	push   $0x0
  pushl $63
c01022a4:	6a 3f                	push   $0x3f
  jmp __alltraps
c01022a6:	e9 ac fd ff ff       	jmp    c0102057 <__alltraps>

c01022ab <vector64>:
.globl vector64
vector64:
  pushl $0
c01022ab:	6a 00                	push   $0x0
  pushl $64
c01022ad:	6a 40                	push   $0x40
  jmp __alltraps
c01022af:	e9 a3 fd ff ff       	jmp    c0102057 <__alltraps>

c01022b4 <vector65>:
.globl vector65
vector65:
  pushl $0
c01022b4:	6a 00                	push   $0x0
  pushl $65
c01022b6:	6a 41                	push   $0x41
  jmp __alltraps
c01022b8:	e9 9a fd ff ff       	jmp    c0102057 <__alltraps>

c01022bd <vector66>:
.globl vector66
vector66:
  pushl $0
c01022bd:	6a 00                	push   $0x0
  pushl $66
c01022bf:	6a 42                	push   $0x42
  jmp __alltraps
c01022c1:	e9 91 fd ff ff       	jmp    c0102057 <__alltraps>

c01022c6 <vector67>:
.globl vector67
vector67:
  pushl $0
c01022c6:	6a 00                	push   $0x0
  pushl $67
c01022c8:	6a 43                	push   $0x43
  jmp __alltraps
c01022ca:	e9 88 fd ff ff       	jmp    c0102057 <__alltraps>

c01022cf <vector68>:
.globl vector68
vector68:
  pushl $0
c01022cf:	6a 00                	push   $0x0
  pushl $68
c01022d1:	6a 44                	push   $0x44
  jmp __alltraps
c01022d3:	e9 7f fd ff ff       	jmp    c0102057 <__alltraps>

c01022d8 <vector69>:
.globl vector69
vector69:
  pushl $0
c01022d8:	6a 00                	push   $0x0
  pushl $69
c01022da:	6a 45                	push   $0x45
  jmp __alltraps
c01022dc:	e9 76 fd ff ff       	jmp    c0102057 <__alltraps>

c01022e1 <vector70>:
.globl vector70
vector70:
  pushl $0
c01022e1:	6a 00                	push   $0x0
  pushl $70
c01022e3:	6a 46                	push   $0x46
  jmp __alltraps
c01022e5:	e9 6d fd ff ff       	jmp    c0102057 <__alltraps>

c01022ea <vector71>:
.globl vector71
vector71:
  pushl $0
c01022ea:	6a 00                	push   $0x0
  pushl $71
c01022ec:	6a 47                	push   $0x47
  jmp __alltraps
c01022ee:	e9 64 fd ff ff       	jmp    c0102057 <__alltraps>

c01022f3 <vector72>:
.globl vector72
vector72:
  pushl $0
c01022f3:	6a 00                	push   $0x0
  pushl $72
c01022f5:	6a 48                	push   $0x48
  jmp __alltraps
c01022f7:	e9 5b fd ff ff       	jmp    c0102057 <__alltraps>

c01022fc <vector73>:
.globl vector73
vector73:
  pushl $0
c01022fc:	6a 00                	push   $0x0
  pushl $73
c01022fe:	6a 49                	push   $0x49
  jmp __alltraps
c0102300:	e9 52 fd ff ff       	jmp    c0102057 <__alltraps>

c0102305 <vector74>:
.globl vector74
vector74:
  pushl $0
c0102305:	6a 00                	push   $0x0
  pushl $74
c0102307:	6a 4a                	push   $0x4a
  jmp __alltraps
c0102309:	e9 49 fd ff ff       	jmp    c0102057 <__alltraps>

c010230e <vector75>:
.globl vector75
vector75:
  pushl $0
c010230e:	6a 00                	push   $0x0
  pushl $75
c0102310:	6a 4b                	push   $0x4b
  jmp __alltraps
c0102312:	e9 40 fd ff ff       	jmp    c0102057 <__alltraps>

c0102317 <vector76>:
.globl vector76
vector76:
  pushl $0
c0102317:	6a 00                	push   $0x0
  pushl $76
c0102319:	6a 4c                	push   $0x4c
  jmp __alltraps
c010231b:	e9 37 fd ff ff       	jmp    c0102057 <__alltraps>

c0102320 <vector77>:
.globl vector77
vector77:
  pushl $0
c0102320:	6a 00                	push   $0x0
  pushl $77
c0102322:	6a 4d                	push   $0x4d
  jmp __alltraps
c0102324:	e9 2e fd ff ff       	jmp    c0102057 <__alltraps>

c0102329 <vector78>:
.globl vector78
vector78:
  pushl $0
c0102329:	6a 00                	push   $0x0
  pushl $78
c010232b:	6a 4e                	push   $0x4e
  jmp __alltraps
c010232d:	e9 25 fd ff ff       	jmp    c0102057 <__alltraps>

c0102332 <vector79>:
.globl vector79
vector79:
  pushl $0
c0102332:	6a 00                	push   $0x0
  pushl $79
c0102334:	6a 4f                	push   $0x4f
  jmp __alltraps
c0102336:	e9 1c fd ff ff       	jmp    c0102057 <__alltraps>

c010233b <vector80>:
.globl vector80
vector80:
  pushl $0
c010233b:	6a 00                	push   $0x0
  pushl $80
c010233d:	6a 50                	push   $0x50
  jmp __alltraps
c010233f:	e9 13 fd ff ff       	jmp    c0102057 <__alltraps>

c0102344 <vector81>:
.globl vector81
vector81:
  pushl $0
c0102344:	6a 00                	push   $0x0
  pushl $81
c0102346:	6a 51                	push   $0x51
  jmp __alltraps
c0102348:	e9 0a fd ff ff       	jmp    c0102057 <__alltraps>

c010234d <vector82>:
.globl vector82
vector82:
  pushl $0
c010234d:	6a 00                	push   $0x0
  pushl $82
c010234f:	6a 52                	push   $0x52
  jmp __alltraps
c0102351:	e9 01 fd ff ff       	jmp    c0102057 <__alltraps>

c0102356 <vector83>:
.globl vector83
vector83:
  pushl $0
c0102356:	6a 00                	push   $0x0
  pushl $83
c0102358:	6a 53                	push   $0x53
  jmp __alltraps
c010235a:	e9 f8 fc ff ff       	jmp    c0102057 <__alltraps>

c010235f <vector84>:
.globl vector84
vector84:
  pushl $0
c010235f:	6a 00                	push   $0x0
  pushl $84
c0102361:	6a 54                	push   $0x54
  jmp __alltraps
c0102363:	e9 ef fc ff ff       	jmp    c0102057 <__alltraps>

c0102368 <vector85>:
.globl vector85
vector85:
  pushl $0
c0102368:	6a 00                	push   $0x0
  pushl $85
c010236a:	6a 55                	push   $0x55
  jmp __alltraps
c010236c:	e9 e6 fc ff ff       	jmp    c0102057 <__alltraps>

c0102371 <vector86>:
.globl vector86
vector86:
  pushl $0
c0102371:	6a 00                	push   $0x0
  pushl $86
c0102373:	6a 56                	push   $0x56
  jmp __alltraps
c0102375:	e9 dd fc ff ff       	jmp    c0102057 <__alltraps>

c010237a <vector87>:
.globl vector87
vector87:
  pushl $0
c010237a:	6a 00                	push   $0x0
  pushl $87
c010237c:	6a 57                	push   $0x57
  jmp __alltraps
c010237e:	e9 d4 fc ff ff       	jmp    c0102057 <__alltraps>

c0102383 <vector88>:
.globl vector88
vector88:
  pushl $0
c0102383:	6a 00                	push   $0x0
  pushl $88
c0102385:	6a 58                	push   $0x58
  jmp __alltraps
c0102387:	e9 cb fc ff ff       	jmp    c0102057 <__alltraps>

c010238c <vector89>:
.globl vector89
vector89:
  pushl $0
c010238c:	6a 00                	push   $0x0
  pushl $89
c010238e:	6a 59                	push   $0x59
  jmp __alltraps
c0102390:	e9 c2 fc ff ff       	jmp    c0102057 <__alltraps>

c0102395 <vector90>:
.globl vector90
vector90:
  pushl $0
c0102395:	6a 00                	push   $0x0
  pushl $90
c0102397:	6a 5a                	push   $0x5a
  jmp __alltraps
c0102399:	e9 b9 fc ff ff       	jmp    c0102057 <__alltraps>

c010239e <vector91>:
.globl vector91
vector91:
  pushl $0
c010239e:	6a 00                	push   $0x0
  pushl $91
c01023a0:	6a 5b                	push   $0x5b
  jmp __alltraps
c01023a2:	e9 b0 fc ff ff       	jmp    c0102057 <__alltraps>

c01023a7 <vector92>:
.globl vector92
vector92:
  pushl $0
c01023a7:	6a 00                	push   $0x0
  pushl $92
c01023a9:	6a 5c                	push   $0x5c
  jmp __alltraps
c01023ab:	e9 a7 fc ff ff       	jmp    c0102057 <__alltraps>

c01023b0 <vector93>:
.globl vector93
vector93:
  pushl $0
c01023b0:	6a 00                	push   $0x0
  pushl $93
c01023b2:	6a 5d                	push   $0x5d
  jmp __alltraps
c01023b4:	e9 9e fc ff ff       	jmp    c0102057 <__alltraps>

c01023b9 <vector94>:
.globl vector94
vector94:
  pushl $0
c01023b9:	6a 00                	push   $0x0
  pushl $94
c01023bb:	6a 5e                	push   $0x5e
  jmp __alltraps
c01023bd:	e9 95 fc ff ff       	jmp    c0102057 <__alltraps>

c01023c2 <vector95>:
.globl vector95
vector95:
  pushl $0
c01023c2:	6a 00                	push   $0x0
  pushl $95
c01023c4:	6a 5f                	push   $0x5f
  jmp __alltraps
c01023c6:	e9 8c fc ff ff       	jmp    c0102057 <__alltraps>

c01023cb <vector96>:
.globl vector96
vector96:
  pushl $0
c01023cb:	6a 00                	push   $0x0
  pushl $96
c01023cd:	6a 60                	push   $0x60
  jmp __alltraps
c01023cf:	e9 83 fc ff ff       	jmp    c0102057 <__alltraps>

c01023d4 <vector97>:
.globl vector97
vector97:
  pushl $0
c01023d4:	6a 00                	push   $0x0
  pushl $97
c01023d6:	6a 61                	push   $0x61
  jmp __alltraps
c01023d8:	e9 7a fc ff ff       	jmp    c0102057 <__alltraps>

c01023dd <vector98>:
.globl vector98
vector98:
  pushl $0
c01023dd:	6a 00                	push   $0x0
  pushl $98
c01023df:	6a 62                	push   $0x62
  jmp __alltraps
c01023e1:	e9 71 fc ff ff       	jmp    c0102057 <__alltraps>

c01023e6 <vector99>:
.globl vector99
vector99:
  pushl $0
c01023e6:	6a 00                	push   $0x0
  pushl $99
c01023e8:	6a 63                	push   $0x63
  jmp __alltraps
c01023ea:	e9 68 fc ff ff       	jmp    c0102057 <__alltraps>

c01023ef <vector100>:
.globl vector100
vector100:
  pushl $0
c01023ef:	6a 00                	push   $0x0
  pushl $100
c01023f1:	6a 64                	push   $0x64
  jmp __alltraps
c01023f3:	e9 5f fc ff ff       	jmp    c0102057 <__alltraps>

c01023f8 <vector101>:
.globl vector101
vector101:
  pushl $0
c01023f8:	6a 00                	push   $0x0
  pushl $101
c01023fa:	6a 65                	push   $0x65
  jmp __alltraps
c01023fc:	e9 56 fc ff ff       	jmp    c0102057 <__alltraps>

c0102401 <vector102>:
.globl vector102
vector102:
  pushl $0
c0102401:	6a 00                	push   $0x0
  pushl $102
c0102403:	6a 66                	push   $0x66
  jmp __alltraps
c0102405:	e9 4d fc ff ff       	jmp    c0102057 <__alltraps>

c010240a <vector103>:
.globl vector103
vector103:
  pushl $0
c010240a:	6a 00                	push   $0x0
  pushl $103
c010240c:	6a 67                	push   $0x67
  jmp __alltraps
c010240e:	e9 44 fc ff ff       	jmp    c0102057 <__alltraps>

c0102413 <vector104>:
.globl vector104
vector104:
  pushl $0
c0102413:	6a 00                	push   $0x0
  pushl $104
c0102415:	6a 68                	push   $0x68
  jmp __alltraps
c0102417:	e9 3b fc ff ff       	jmp    c0102057 <__alltraps>

c010241c <vector105>:
.globl vector105
vector105:
  pushl $0
c010241c:	6a 00                	push   $0x0
  pushl $105
c010241e:	6a 69                	push   $0x69
  jmp __alltraps
c0102420:	e9 32 fc ff ff       	jmp    c0102057 <__alltraps>

c0102425 <vector106>:
.globl vector106
vector106:
  pushl $0
c0102425:	6a 00                	push   $0x0
  pushl $106
c0102427:	6a 6a                	push   $0x6a
  jmp __alltraps
c0102429:	e9 29 fc ff ff       	jmp    c0102057 <__alltraps>

c010242e <vector107>:
.globl vector107
vector107:
  pushl $0
c010242e:	6a 00                	push   $0x0
  pushl $107
c0102430:	6a 6b                	push   $0x6b
  jmp __alltraps
c0102432:	e9 20 fc ff ff       	jmp    c0102057 <__alltraps>

c0102437 <vector108>:
.globl vector108
vector108:
  pushl $0
c0102437:	6a 00                	push   $0x0
  pushl $108
c0102439:	6a 6c                	push   $0x6c
  jmp __alltraps
c010243b:	e9 17 fc ff ff       	jmp    c0102057 <__alltraps>

c0102440 <vector109>:
.globl vector109
vector109:
  pushl $0
c0102440:	6a 00                	push   $0x0
  pushl $109
c0102442:	6a 6d                	push   $0x6d
  jmp __alltraps
c0102444:	e9 0e fc ff ff       	jmp    c0102057 <__alltraps>

c0102449 <vector110>:
.globl vector110
vector110:
  pushl $0
c0102449:	6a 00                	push   $0x0
  pushl $110
c010244b:	6a 6e                	push   $0x6e
  jmp __alltraps
c010244d:	e9 05 fc ff ff       	jmp    c0102057 <__alltraps>

c0102452 <vector111>:
.globl vector111
vector111:
  pushl $0
c0102452:	6a 00                	push   $0x0
  pushl $111
c0102454:	6a 6f                	push   $0x6f
  jmp __alltraps
c0102456:	e9 fc fb ff ff       	jmp    c0102057 <__alltraps>

c010245b <vector112>:
.globl vector112
vector112:
  pushl $0
c010245b:	6a 00                	push   $0x0
  pushl $112
c010245d:	6a 70                	push   $0x70
  jmp __alltraps
c010245f:	e9 f3 fb ff ff       	jmp    c0102057 <__alltraps>

c0102464 <vector113>:
.globl vector113
vector113:
  pushl $0
c0102464:	6a 00                	push   $0x0
  pushl $113
c0102466:	6a 71                	push   $0x71
  jmp __alltraps
c0102468:	e9 ea fb ff ff       	jmp    c0102057 <__alltraps>

c010246d <vector114>:
.globl vector114
vector114:
  pushl $0
c010246d:	6a 00                	push   $0x0
  pushl $114
c010246f:	6a 72                	push   $0x72
  jmp __alltraps
c0102471:	e9 e1 fb ff ff       	jmp    c0102057 <__alltraps>

c0102476 <vector115>:
.globl vector115
vector115:
  pushl $0
c0102476:	6a 00                	push   $0x0
  pushl $115
c0102478:	6a 73                	push   $0x73
  jmp __alltraps
c010247a:	e9 d8 fb ff ff       	jmp    c0102057 <__alltraps>

c010247f <vector116>:
.globl vector116
vector116:
  pushl $0
c010247f:	6a 00                	push   $0x0
  pushl $116
c0102481:	6a 74                	push   $0x74
  jmp __alltraps
c0102483:	e9 cf fb ff ff       	jmp    c0102057 <__alltraps>

c0102488 <vector117>:
.globl vector117
vector117:
  pushl $0
c0102488:	6a 00                	push   $0x0
  pushl $117
c010248a:	6a 75                	push   $0x75
  jmp __alltraps
c010248c:	e9 c6 fb ff ff       	jmp    c0102057 <__alltraps>

c0102491 <vector118>:
.globl vector118
vector118:
  pushl $0
c0102491:	6a 00                	push   $0x0
  pushl $118
c0102493:	6a 76                	push   $0x76
  jmp __alltraps
c0102495:	e9 bd fb ff ff       	jmp    c0102057 <__alltraps>

c010249a <vector119>:
.globl vector119
vector119:
  pushl $0
c010249a:	6a 00                	push   $0x0
  pushl $119
c010249c:	6a 77                	push   $0x77
  jmp __alltraps
c010249e:	e9 b4 fb ff ff       	jmp    c0102057 <__alltraps>

c01024a3 <vector120>:
.globl vector120
vector120:
  pushl $0
c01024a3:	6a 00                	push   $0x0
  pushl $120
c01024a5:	6a 78                	push   $0x78
  jmp __alltraps
c01024a7:	e9 ab fb ff ff       	jmp    c0102057 <__alltraps>

c01024ac <vector121>:
.globl vector121
vector121:
  pushl $0
c01024ac:	6a 00                	push   $0x0
  pushl $121
c01024ae:	6a 79                	push   $0x79
  jmp __alltraps
c01024b0:	e9 a2 fb ff ff       	jmp    c0102057 <__alltraps>

c01024b5 <vector122>:
.globl vector122
vector122:
  pushl $0
c01024b5:	6a 00                	push   $0x0
  pushl $122
c01024b7:	6a 7a                	push   $0x7a
  jmp __alltraps
c01024b9:	e9 99 fb ff ff       	jmp    c0102057 <__alltraps>

c01024be <vector123>:
.globl vector123
vector123:
  pushl $0
c01024be:	6a 00                	push   $0x0
  pushl $123
c01024c0:	6a 7b                	push   $0x7b
  jmp __alltraps
c01024c2:	e9 90 fb ff ff       	jmp    c0102057 <__alltraps>

c01024c7 <vector124>:
.globl vector124
vector124:
  pushl $0
c01024c7:	6a 00                	push   $0x0
  pushl $124
c01024c9:	6a 7c                	push   $0x7c
  jmp __alltraps
c01024cb:	e9 87 fb ff ff       	jmp    c0102057 <__alltraps>

c01024d0 <vector125>:
.globl vector125
vector125:
  pushl $0
c01024d0:	6a 00                	push   $0x0
  pushl $125
c01024d2:	6a 7d                	push   $0x7d
  jmp __alltraps
c01024d4:	e9 7e fb ff ff       	jmp    c0102057 <__alltraps>

c01024d9 <vector126>:
.globl vector126
vector126:
  pushl $0
c01024d9:	6a 00                	push   $0x0
  pushl $126
c01024db:	6a 7e                	push   $0x7e
  jmp __alltraps
c01024dd:	e9 75 fb ff ff       	jmp    c0102057 <__alltraps>

c01024e2 <vector127>:
.globl vector127
vector127:
  pushl $0
c01024e2:	6a 00                	push   $0x0
  pushl $127
c01024e4:	6a 7f                	push   $0x7f
  jmp __alltraps
c01024e6:	e9 6c fb ff ff       	jmp    c0102057 <__alltraps>

c01024eb <vector128>:
.globl vector128
vector128:
  pushl $0
c01024eb:	6a 00                	push   $0x0
  pushl $128
c01024ed:	68 80 00 00 00       	push   $0x80
  jmp __alltraps
c01024f2:	e9 60 fb ff ff       	jmp    c0102057 <__alltraps>

c01024f7 <vector129>:
.globl vector129
vector129:
  pushl $0
c01024f7:	6a 00                	push   $0x0
  pushl $129
c01024f9:	68 81 00 00 00       	push   $0x81
  jmp __alltraps
c01024fe:	e9 54 fb ff ff       	jmp    c0102057 <__alltraps>

c0102503 <vector130>:
.globl vector130
vector130:
  pushl $0
c0102503:	6a 00                	push   $0x0
  pushl $130
c0102505:	68 82 00 00 00       	push   $0x82
  jmp __alltraps
c010250a:	e9 48 fb ff ff       	jmp    c0102057 <__alltraps>

c010250f <vector131>:
.globl vector131
vector131:
  pushl $0
c010250f:	6a 00                	push   $0x0
  pushl $131
c0102511:	68 83 00 00 00       	push   $0x83
  jmp __alltraps
c0102516:	e9 3c fb ff ff       	jmp    c0102057 <__alltraps>

c010251b <vector132>:
.globl vector132
vector132:
  pushl $0
c010251b:	6a 00                	push   $0x0
  pushl $132
c010251d:	68 84 00 00 00       	push   $0x84
  jmp __alltraps
c0102522:	e9 30 fb ff ff       	jmp    c0102057 <__alltraps>

c0102527 <vector133>:
.globl vector133
vector133:
  pushl $0
c0102527:	6a 00                	push   $0x0
  pushl $133
c0102529:	68 85 00 00 00       	push   $0x85
  jmp __alltraps
c010252e:	e9 24 fb ff ff       	jmp    c0102057 <__alltraps>

c0102533 <vector134>:
.globl vector134
vector134:
  pushl $0
c0102533:	6a 00                	push   $0x0
  pushl $134
c0102535:	68 86 00 00 00       	push   $0x86
  jmp __alltraps
c010253a:	e9 18 fb ff ff       	jmp    c0102057 <__alltraps>

c010253f <vector135>:
.globl vector135
vector135:
  pushl $0
c010253f:	6a 00                	push   $0x0
  pushl $135
c0102541:	68 87 00 00 00       	push   $0x87
  jmp __alltraps
c0102546:	e9 0c fb ff ff       	jmp    c0102057 <__alltraps>

c010254b <vector136>:
.globl vector136
vector136:
  pushl $0
c010254b:	6a 00                	push   $0x0
  pushl $136
c010254d:	68 88 00 00 00       	push   $0x88
  jmp __alltraps
c0102552:	e9 00 fb ff ff       	jmp    c0102057 <__alltraps>

c0102557 <vector137>:
.globl vector137
vector137:
  pushl $0
c0102557:	6a 00                	push   $0x0
  pushl $137
c0102559:	68 89 00 00 00       	push   $0x89
  jmp __alltraps
c010255e:	e9 f4 fa ff ff       	jmp    c0102057 <__alltraps>

c0102563 <vector138>:
.globl vector138
vector138:
  pushl $0
c0102563:	6a 00                	push   $0x0
  pushl $138
c0102565:	68 8a 00 00 00       	push   $0x8a
  jmp __alltraps
c010256a:	e9 e8 fa ff ff       	jmp    c0102057 <__alltraps>

c010256f <vector139>:
.globl vector139
vector139:
  pushl $0
c010256f:	6a 00                	push   $0x0
  pushl $139
c0102571:	68 8b 00 00 00       	push   $0x8b
  jmp __alltraps
c0102576:	e9 dc fa ff ff       	jmp    c0102057 <__alltraps>

c010257b <vector140>:
.globl vector140
vector140:
  pushl $0
c010257b:	6a 00                	push   $0x0
  pushl $140
c010257d:	68 8c 00 00 00       	push   $0x8c
  jmp __alltraps
c0102582:	e9 d0 fa ff ff       	jmp    c0102057 <__alltraps>

c0102587 <vector141>:
.globl vector141
vector141:
  pushl $0
c0102587:	6a 00                	push   $0x0
  pushl $141
c0102589:	68 8d 00 00 00       	push   $0x8d
  jmp __alltraps
c010258e:	e9 c4 fa ff ff       	jmp    c0102057 <__alltraps>

c0102593 <vector142>:
.globl vector142
vector142:
  pushl $0
c0102593:	6a 00                	push   $0x0
  pushl $142
c0102595:	68 8e 00 00 00       	push   $0x8e
  jmp __alltraps
c010259a:	e9 b8 fa ff ff       	jmp    c0102057 <__alltraps>

c010259f <vector143>:
.globl vector143
vector143:
  pushl $0
c010259f:	6a 00                	push   $0x0
  pushl $143
c01025a1:	68 8f 00 00 00       	push   $0x8f
  jmp __alltraps
c01025a6:	e9 ac fa ff ff       	jmp    c0102057 <__alltraps>

c01025ab <vector144>:
.globl vector144
vector144:
  pushl $0
c01025ab:	6a 00                	push   $0x0
  pushl $144
c01025ad:	68 90 00 00 00       	push   $0x90
  jmp __alltraps
c01025b2:	e9 a0 fa ff ff       	jmp    c0102057 <__alltraps>

c01025b7 <vector145>:
.globl vector145
vector145:
  pushl $0
c01025b7:	6a 00                	push   $0x0
  pushl $145
c01025b9:	68 91 00 00 00       	push   $0x91
  jmp __alltraps
c01025be:	e9 94 fa ff ff       	jmp    c0102057 <__alltraps>

c01025c3 <vector146>:
.globl vector146
vector146:
  pushl $0
c01025c3:	6a 00                	push   $0x0
  pushl $146
c01025c5:	68 92 00 00 00       	push   $0x92
  jmp __alltraps
c01025ca:	e9 88 fa ff ff       	jmp    c0102057 <__alltraps>

c01025cf <vector147>:
.globl vector147
vector147:
  pushl $0
c01025cf:	6a 00                	push   $0x0
  pushl $147
c01025d1:	68 93 00 00 00       	push   $0x93
  jmp __alltraps
c01025d6:	e9 7c fa ff ff       	jmp    c0102057 <__alltraps>

c01025db <vector148>:
.globl vector148
vector148:
  pushl $0
c01025db:	6a 00                	push   $0x0
  pushl $148
c01025dd:	68 94 00 00 00       	push   $0x94
  jmp __alltraps
c01025e2:	e9 70 fa ff ff       	jmp    c0102057 <__alltraps>

c01025e7 <vector149>:
.globl vector149
vector149:
  pushl $0
c01025e7:	6a 00                	push   $0x0
  pushl $149
c01025e9:	68 95 00 00 00       	push   $0x95
  jmp __alltraps
c01025ee:	e9 64 fa ff ff       	jmp    c0102057 <__alltraps>

c01025f3 <vector150>:
.globl vector150
vector150:
  pushl $0
c01025f3:	6a 00                	push   $0x0
  pushl $150
c01025f5:	68 96 00 00 00       	push   $0x96
  jmp __alltraps
c01025fa:	e9 58 fa ff ff       	jmp    c0102057 <__alltraps>

c01025ff <vector151>:
.globl vector151
vector151:
  pushl $0
c01025ff:	6a 00                	push   $0x0
  pushl $151
c0102601:	68 97 00 00 00       	push   $0x97
  jmp __alltraps
c0102606:	e9 4c fa ff ff       	jmp    c0102057 <__alltraps>

c010260b <vector152>:
.globl vector152
vector152:
  pushl $0
c010260b:	6a 00                	push   $0x0
  pushl $152
c010260d:	68 98 00 00 00       	push   $0x98
  jmp __alltraps
c0102612:	e9 40 fa ff ff       	jmp    c0102057 <__alltraps>

c0102617 <vector153>:
.globl vector153
vector153:
  pushl $0
c0102617:	6a 00                	push   $0x0
  pushl $153
c0102619:	68 99 00 00 00       	push   $0x99
  jmp __alltraps
c010261e:	e9 34 fa ff ff       	jmp    c0102057 <__alltraps>

c0102623 <vector154>:
.globl vector154
vector154:
  pushl $0
c0102623:	6a 00                	push   $0x0
  pushl $154
c0102625:	68 9a 00 00 00       	push   $0x9a
  jmp __alltraps
c010262a:	e9 28 fa ff ff       	jmp    c0102057 <__alltraps>

c010262f <vector155>:
.globl vector155
vector155:
  pushl $0
c010262f:	6a 00                	push   $0x0
  pushl $155
c0102631:	68 9b 00 00 00       	push   $0x9b
  jmp __alltraps
c0102636:	e9 1c fa ff ff       	jmp    c0102057 <__alltraps>

c010263b <vector156>:
.globl vector156
vector156:
  pushl $0
c010263b:	6a 00                	push   $0x0
  pushl $156
c010263d:	68 9c 00 00 00       	push   $0x9c
  jmp __alltraps
c0102642:	e9 10 fa ff ff       	jmp    c0102057 <__alltraps>

c0102647 <vector157>:
.globl vector157
vector157:
  pushl $0
c0102647:	6a 00                	push   $0x0
  pushl $157
c0102649:	68 9d 00 00 00       	push   $0x9d
  jmp __alltraps
c010264e:	e9 04 fa ff ff       	jmp    c0102057 <__alltraps>

c0102653 <vector158>:
.globl vector158
vector158:
  pushl $0
c0102653:	6a 00                	push   $0x0
  pushl $158
c0102655:	68 9e 00 00 00       	push   $0x9e
  jmp __alltraps
c010265a:	e9 f8 f9 ff ff       	jmp    c0102057 <__alltraps>

c010265f <vector159>:
.globl vector159
vector159:
  pushl $0
c010265f:	6a 00                	push   $0x0
  pushl $159
c0102661:	68 9f 00 00 00       	push   $0x9f
  jmp __alltraps
c0102666:	e9 ec f9 ff ff       	jmp    c0102057 <__alltraps>

c010266b <vector160>:
.globl vector160
vector160:
  pushl $0
c010266b:	6a 00                	push   $0x0
  pushl $160
c010266d:	68 a0 00 00 00       	push   $0xa0
  jmp __alltraps
c0102672:	e9 e0 f9 ff ff       	jmp    c0102057 <__alltraps>

c0102677 <vector161>:
.globl vector161
vector161:
  pushl $0
c0102677:	6a 00                	push   $0x0
  pushl $161
c0102679:	68 a1 00 00 00       	push   $0xa1
  jmp __alltraps
c010267e:	e9 d4 f9 ff ff       	jmp    c0102057 <__alltraps>

c0102683 <vector162>:
.globl vector162
vector162:
  pushl $0
c0102683:	6a 00                	push   $0x0
  pushl $162
c0102685:	68 a2 00 00 00       	push   $0xa2
  jmp __alltraps
c010268a:	e9 c8 f9 ff ff       	jmp    c0102057 <__alltraps>

c010268f <vector163>:
.globl vector163
vector163:
  pushl $0
c010268f:	6a 00                	push   $0x0
  pushl $163
c0102691:	68 a3 00 00 00       	push   $0xa3
  jmp __alltraps
c0102696:	e9 bc f9 ff ff       	jmp    c0102057 <__alltraps>

c010269b <vector164>:
.globl vector164
vector164:
  pushl $0
c010269b:	6a 00                	push   $0x0
  pushl $164
c010269d:	68 a4 00 00 00       	push   $0xa4
  jmp __alltraps
c01026a2:	e9 b0 f9 ff ff       	jmp    c0102057 <__alltraps>

c01026a7 <vector165>:
.globl vector165
vector165:
  pushl $0
c01026a7:	6a 00                	push   $0x0
  pushl $165
c01026a9:	68 a5 00 00 00       	push   $0xa5
  jmp __alltraps
c01026ae:	e9 a4 f9 ff ff       	jmp    c0102057 <__alltraps>

c01026b3 <vector166>:
.globl vector166
vector166:
  pushl $0
c01026b3:	6a 00                	push   $0x0
  pushl $166
c01026b5:	68 a6 00 00 00       	push   $0xa6
  jmp __alltraps
c01026ba:	e9 98 f9 ff ff       	jmp    c0102057 <__alltraps>

c01026bf <vector167>:
.globl vector167
vector167:
  pushl $0
c01026bf:	6a 00                	push   $0x0
  pushl $167
c01026c1:	68 a7 00 00 00       	push   $0xa7
  jmp __alltraps
c01026c6:	e9 8c f9 ff ff       	jmp    c0102057 <__alltraps>

c01026cb <vector168>:
.globl vector168
vector168:
  pushl $0
c01026cb:	6a 00                	push   $0x0
  pushl $168
c01026cd:	68 a8 00 00 00       	push   $0xa8
  jmp __alltraps
c01026d2:	e9 80 f9 ff ff       	jmp    c0102057 <__alltraps>

c01026d7 <vector169>:
.globl vector169
vector169:
  pushl $0
c01026d7:	6a 00                	push   $0x0
  pushl $169
c01026d9:	68 a9 00 00 00       	push   $0xa9
  jmp __alltraps
c01026de:	e9 74 f9 ff ff       	jmp    c0102057 <__alltraps>

c01026e3 <vector170>:
.globl vector170
vector170:
  pushl $0
c01026e3:	6a 00                	push   $0x0
  pushl $170
c01026e5:	68 aa 00 00 00       	push   $0xaa
  jmp __alltraps
c01026ea:	e9 68 f9 ff ff       	jmp    c0102057 <__alltraps>

c01026ef <vector171>:
.globl vector171
vector171:
  pushl $0
c01026ef:	6a 00                	push   $0x0
  pushl $171
c01026f1:	68 ab 00 00 00       	push   $0xab
  jmp __alltraps
c01026f6:	e9 5c f9 ff ff       	jmp    c0102057 <__alltraps>

c01026fb <vector172>:
.globl vector172
vector172:
  pushl $0
c01026fb:	6a 00                	push   $0x0
  pushl $172
c01026fd:	68 ac 00 00 00       	push   $0xac
  jmp __alltraps
c0102702:	e9 50 f9 ff ff       	jmp    c0102057 <__alltraps>

c0102707 <vector173>:
.globl vector173
vector173:
  pushl $0
c0102707:	6a 00                	push   $0x0
  pushl $173
c0102709:	68 ad 00 00 00       	push   $0xad
  jmp __alltraps
c010270e:	e9 44 f9 ff ff       	jmp    c0102057 <__alltraps>

c0102713 <vector174>:
.globl vector174
vector174:
  pushl $0
c0102713:	6a 00                	push   $0x0
  pushl $174
c0102715:	68 ae 00 00 00       	push   $0xae
  jmp __alltraps
c010271a:	e9 38 f9 ff ff       	jmp    c0102057 <__alltraps>

c010271f <vector175>:
.globl vector175
vector175:
  pushl $0
c010271f:	6a 00                	push   $0x0
  pushl $175
c0102721:	68 af 00 00 00       	push   $0xaf
  jmp __alltraps
c0102726:	e9 2c f9 ff ff       	jmp    c0102057 <__alltraps>

c010272b <vector176>:
.globl vector176
vector176:
  pushl $0
c010272b:	6a 00                	push   $0x0
  pushl $176
c010272d:	68 b0 00 00 00       	push   $0xb0
  jmp __alltraps
c0102732:	e9 20 f9 ff ff       	jmp    c0102057 <__alltraps>

c0102737 <vector177>:
.globl vector177
vector177:
  pushl $0
c0102737:	6a 00                	push   $0x0
  pushl $177
c0102739:	68 b1 00 00 00       	push   $0xb1
  jmp __alltraps
c010273e:	e9 14 f9 ff ff       	jmp    c0102057 <__alltraps>

c0102743 <vector178>:
.globl vector178
vector178:
  pushl $0
c0102743:	6a 00                	push   $0x0
  pushl $178
c0102745:	68 b2 00 00 00       	push   $0xb2
  jmp __alltraps
c010274a:	e9 08 f9 ff ff       	jmp    c0102057 <__alltraps>

c010274f <vector179>:
.globl vector179
vector179:
  pushl $0
c010274f:	6a 00                	push   $0x0
  pushl $179
c0102751:	68 b3 00 00 00       	push   $0xb3
  jmp __alltraps
c0102756:	e9 fc f8 ff ff       	jmp    c0102057 <__alltraps>

c010275b <vector180>:
.globl vector180
vector180:
  pushl $0
c010275b:	6a 00                	push   $0x0
  pushl $180
c010275d:	68 b4 00 00 00       	push   $0xb4
  jmp __alltraps
c0102762:	e9 f0 f8 ff ff       	jmp    c0102057 <__alltraps>

c0102767 <vector181>:
.globl vector181
vector181:
  pushl $0
c0102767:	6a 00                	push   $0x0
  pushl $181
c0102769:	68 b5 00 00 00       	push   $0xb5
  jmp __alltraps
c010276e:	e9 e4 f8 ff ff       	jmp    c0102057 <__alltraps>

c0102773 <vector182>:
.globl vector182
vector182:
  pushl $0
c0102773:	6a 00                	push   $0x0
  pushl $182
c0102775:	68 b6 00 00 00       	push   $0xb6
  jmp __alltraps
c010277a:	e9 d8 f8 ff ff       	jmp    c0102057 <__alltraps>

c010277f <vector183>:
.globl vector183
vector183:
  pushl $0
c010277f:	6a 00                	push   $0x0
  pushl $183
c0102781:	68 b7 00 00 00       	push   $0xb7
  jmp __alltraps
c0102786:	e9 cc f8 ff ff       	jmp    c0102057 <__alltraps>

c010278b <vector184>:
.globl vector184
vector184:
  pushl $0
c010278b:	6a 00                	push   $0x0
  pushl $184
c010278d:	68 b8 00 00 00       	push   $0xb8
  jmp __alltraps
c0102792:	e9 c0 f8 ff ff       	jmp    c0102057 <__alltraps>

c0102797 <vector185>:
.globl vector185
vector185:
  pushl $0
c0102797:	6a 00                	push   $0x0
  pushl $185
c0102799:	68 b9 00 00 00       	push   $0xb9
  jmp __alltraps
c010279e:	e9 b4 f8 ff ff       	jmp    c0102057 <__alltraps>

c01027a3 <vector186>:
.globl vector186
vector186:
  pushl $0
c01027a3:	6a 00                	push   $0x0
  pushl $186
c01027a5:	68 ba 00 00 00       	push   $0xba
  jmp __alltraps
c01027aa:	e9 a8 f8 ff ff       	jmp    c0102057 <__alltraps>

c01027af <vector187>:
.globl vector187
vector187:
  pushl $0
c01027af:	6a 00                	push   $0x0
  pushl $187
c01027b1:	68 bb 00 00 00       	push   $0xbb
  jmp __alltraps
c01027b6:	e9 9c f8 ff ff       	jmp    c0102057 <__alltraps>

c01027bb <vector188>:
.globl vector188
vector188:
  pushl $0
c01027bb:	6a 00                	push   $0x0
  pushl $188
c01027bd:	68 bc 00 00 00       	push   $0xbc
  jmp __alltraps
c01027c2:	e9 90 f8 ff ff       	jmp    c0102057 <__alltraps>

c01027c7 <vector189>:
.globl vector189
vector189:
  pushl $0
c01027c7:	6a 00                	push   $0x0
  pushl $189
c01027c9:	68 bd 00 00 00       	push   $0xbd
  jmp __alltraps
c01027ce:	e9 84 f8 ff ff       	jmp    c0102057 <__alltraps>

c01027d3 <vector190>:
.globl vector190
vector190:
  pushl $0
c01027d3:	6a 00                	push   $0x0
  pushl $190
c01027d5:	68 be 00 00 00       	push   $0xbe
  jmp __alltraps
c01027da:	e9 78 f8 ff ff       	jmp    c0102057 <__alltraps>

c01027df <vector191>:
.globl vector191
vector191:
  pushl $0
c01027df:	6a 00                	push   $0x0
  pushl $191
c01027e1:	68 bf 00 00 00       	push   $0xbf
  jmp __alltraps
c01027e6:	e9 6c f8 ff ff       	jmp    c0102057 <__alltraps>

c01027eb <vector192>:
.globl vector192
vector192:
  pushl $0
c01027eb:	6a 00                	push   $0x0
  pushl $192
c01027ed:	68 c0 00 00 00       	push   $0xc0
  jmp __alltraps
c01027f2:	e9 60 f8 ff ff       	jmp    c0102057 <__alltraps>

c01027f7 <vector193>:
.globl vector193
vector193:
  pushl $0
c01027f7:	6a 00                	push   $0x0
  pushl $193
c01027f9:	68 c1 00 00 00       	push   $0xc1
  jmp __alltraps
c01027fe:	e9 54 f8 ff ff       	jmp    c0102057 <__alltraps>

c0102803 <vector194>:
.globl vector194
vector194:
  pushl $0
c0102803:	6a 00                	push   $0x0
  pushl $194
c0102805:	68 c2 00 00 00       	push   $0xc2
  jmp __alltraps
c010280a:	e9 48 f8 ff ff       	jmp    c0102057 <__alltraps>

c010280f <vector195>:
.globl vector195
vector195:
  pushl $0
c010280f:	6a 00                	push   $0x0
  pushl $195
c0102811:	68 c3 00 00 00       	push   $0xc3
  jmp __alltraps
c0102816:	e9 3c f8 ff ff       	jmp    c0102057 <__alltraps>

c010281b <vector196>:
.globl vector196
vector196:
  pushl $0
c010281b:	6a 00                	push   $0x0
  pushl $196
c010281d:	68 c4 00 00 00       	push   $0xc4
  jmp __alltraps
c0102822:	e9 30 f8 ff ff       	jmp    c0102057 <__alltraps>

c0102827 <vector197>:
.globl vector197
vector197:
  pushl $0
c0102827:	6a 00                	push   $0x0
  pushl $197
c0102829:	68 c5 00 00 00       	push   $0xc5
  jmp __alltraps
c010282e:	e9 24 f8 ff ff       	jmp    c0102057 <__alltraps>

c0102833 <vector198>:
.globl vector198
vector198:
  pushl $0
c0102833:	6a 00                	push   $0x0
  pushl $198
c0102835:	68 c6 00 00 00       	push   $0xc6
  jmp __alltraps
c010283a:	e9 18 f8 ff ff       	jmp    c0102057 <__alltraps>

c010283f <vector199>:
.globl vector199
vector199:
  pushl $0
c010283f:	6a 00                	push   $0x0
  pushl $199
c0102841:	68 c7 00 00 00       	push   $0xc7
  jmp __alltraps
c0102846:	e9 0c f8 ff ff       	jmp    c0102057 <__alltraps>

c010284b <vector200>:
.globl vector200
vector200:
  pushl $0
c010284b:	6a 00                	push   $0x0
  pushl $200
c010284d:	68 c8 00 00 00       	push   $0xc8
  jmp __alltraps
c0102852:	e9 00 f8 ff ff       	jmp    c0102057 <__alltraps>

c0102857 <vector201>:
.globl vector201
vector201:
  pushl $0
c0102857:	6a 00                	push   $0x0
  pushl $201
c0102859:	68 c9 00 00 00       	push   $0xc9
  jmp __alltraps
c010285e:	e9 f4 f7 ff ff       	jmp    c0102057 <__alltraps>

c0102863 <vector202>:
.globl vector202
vector202:
  pushl $0
c0102863:	6a 00                	push   $0x0
  pushl $202
c0102865:	68 ca 00 00 00       	push   $0xca
  jmp __alltraps
c010286a:	e9 e8 f7 ff ff       	jmp    c0102057 <__alltraps>

c010286f <vector203>:
.globl vector203
vector203:
  pushl $0
c010286f:	6a 00                	push   $0x0
  pushl $203
c0102871:	68 cb 00 00 00       	push   $0xcb
  jmp __alltraps
c0102876:	e9 dc f7 ff ff       	jmp    c0102057 <__alltraps>

c010287b <vector204>:
.globl vector204
vector204:
  pushl $0
c010287b:	6a 00                	push   $0x0
  pushl $204
c010287d:	68 cc 00 00 00       	push   $0xcc
  jmp __alltraps
c0102882:	e9 d0 f7 ff ff       	jmp    c0102057 <__alltraps>

c0102887 <vector205>:
.globl vector205
vector205:
  pushl $0
c0102887:	6a 00                	push   $0x0
  pushl $205
c0102889:	68 cd 00 00 00       	push   $0xcd
  jmp __alltraps
c010288e:	e9 c4 f7 ff ff       	jmp    c0102057 <__alltraps>

c0102893 <vector206>:
.globl vector206
vector206:
  pushl $0
c0102893:	6a 00                	push   $0x0
  pushl $206
c0102895:	68 ce 00 00 00       	push   $0xce
  jmp __alltraps
c010289a:	e9 b8 f7 ff ff       	jmp    c0102057 <__alltraps>

c010289f <vector207>:
.globl vector207
vector207:
  pushl $0
c010289f:	6a 00                	push   $0x0
  pushl $207
c01028a1:	68 cf 00 00 00       	push   $0xcf
  jmp __alltraps
c01028a6:	e9 ac f7 ff ff       	jmp    c0102057 <__alltraps>

c01028ab <vector208>:
.globl vector208
vector208:
  pushl $0
c01028ab:	6a 00                	push   $0x0
  pushl $208
c01028ad:	68 d0 00 00 00       	push   $0xd0
  jmp __alltraps
c01028b2:	e9 a0 f7 ff ff       	jmp    c0102057 <__alltraps>

c01028b7 <vector209>:
.globl vector209
vector209:
  pushl $0
c01028b7:	6a 00                	push   $0x0
  pushl $209
c01028b9:	68 d1 00 00 00       	push   $0xd1
  jmp __alltraps
c01028be:	e9 94 f7 ff ff       	jmp    c0102057 <__alltraps>

c01028c3 <vector210>:
.globl vector210
vector210:
  pushl $0
c01028c3:	6a 00                	push   $0x0
  pushl $210
c01028c5:	68 d2 00 00 00       	push   $0xd2
  jmp __alltraps
c01028ca:	e9 88 f7 ff ff       	jmp    c0102057 <__alltraps>

c01028cf <vector211>:
.globl vector211
vector211:
  pushl $0
c01028cf:	6a 00                	push   $0x0
  pushl $211
c01028d1:	68 d3 00 00 00       	push   $0xd3
  jmp __alltraps
c01028d6:	e9 7c f7 ff ff       	jmp    c0102057 <__alltraps>

c01028db <vector212>:
.globl vector212
vector212:
  pushl $0
c01028db:	6a 00                	push   $0x0
  pushl $212
c01028dd:	68 d4 00 00 00       	push   $0xd4
  jmp __alltraps
c01028e2:	e9 70 f7 ff ff       	jmp    c0102057 <__alltraps>

c01028e7 <vector213>:
.globl vector213
vector213:
  pushl $0
c01028e7:	6a 00                	push   $0x0
  pushl $213
c01028e9:	68 d5 00 00 00       	push   $0xd5
  jmp __alltraps
c01028ee:	e9 64 f7 ff ff       	jmp    c0102057 <__alltraps>

c01028f3 <vector214>:
.globl vector214
vector214:
  pushl $0
c01028f3:	6a 00                	push   $0x0
  pushl $214
c01028f5:	68 d6 00 00 00       	push   $0xd6
  jmp __alltraps
c01028fa:	e9 58 f7 ff ff       	jmp    c0102057 <__alltraps>

c01028ff <vector215>:
.globl vector215
vector215:
  pushl $0
c01028ff:	6a 00                	push   $0x0
  pushl $215
c0102901:	68 d7 00 00 00       	push   $0xd7
  jmp __alltraps
c0102906:	e9 4c f7 ff ff       	jmp    c0102057 <__alltraps>

c010290b <vector216>:
.globl vector216
vector216:
  pushl $0
c010290b:	6a 00                	push   $0x0
  pushl $216
c010290d:	68 d8 00 00 00       	push   $0xd8
  jmp __alltraps
c0102912:	e9 40 f7 ff ff       	jmp    c0102057 <__alltraps>

c0102917 <vector217>:
.globl vector217
vector217:
  pushl $0
c0102917:	6a 00                	push   $0x0
  pushl $217
c0102919:	68 d9 00 00 00       	push   $0xd9
  jmp __alltraps
c010291e:	e9 34 f7 ff ff       	jmp    c0102057 <__alltraps>

c0102923 <vector218>:
.globl vector218
vector218:
  pushl $0
c0102923:	6a 00                	push   $0x0
  pushl $218
c0102925:	68 da 00 00 00       	push   $0xda
  jmp __alltraps
c010292a:	e9 28 f7 ff ff       	jmp    c0102057 <__alltraps>

c010292f <vector219>:
.globl vector219
vector219:
  pushl $0
c010292f:	6a 00                	push   $0x0
  pushl $219
c0102931:	68 db 00 00 00       	push   $0xdb
  jmp __alltraps
c0102936:	e9 1c f7 ff ff       	jmp    c0102057 <__alltraps>

c010293b <vector220>:
.globl vector220
vector220:
  pushl $0
c010293b:	6a 00                	push   $0x0
  pushl $220
c010293d:	68 dc 00 00 00       	push   $0xdc
  jmp __alltraps
c0102942:	e9 10 f7 ff ff       	jmp    c0102057 <__alltraps>

c0102947 <vector221>:
.globl vector221
vector221:
  pushl $0
c0102947:	6a 00                	push   $0x0
  pushl $221
c0102949:	68 dd 00 00 00       	push   $0xdd
  jmp __alltraps
c010294e:	e9 04 f7 ff ff       	jmp    c0102057 <__alltraps>

c0102953 <vector222>:
.globl vector222
vector222:
  pushl $0
c0102953:	6a 00                	push   $0x0
  pushl $222
c0102955:	68 de 00 00 00       	push   $0xde
  jmp __alltraps
c010295a:	e9 f8 f6 ff ff       	jmp    c0102057 <__alltraps>

c010295f <vector223>:
.globl vector223
vector223:
  pushl $0
c010295f:	6a 00                	push   $0x0
  pushl $223
c0102961:	68 df 00 00 00       	push   $0xdf
  jmp __alltraps
c0102966:	e9 ec f6 ff ff       	jmp    c0102057 <__alltraps>

c010296b <vector224>:
.globl vector224
vector224:
  pushl $0
c010296b:	6a 00                	push   $0x0
  pushl $224
c010296d:	68 e0 00 00 00       	push   $0xe0
  jmp __alltraps
c0102972:	e9 e0 f6 ff ff       	jmp    c0102057 <__alltraps>

c0102977 <vector225>:
.globl vector225
vector225:
  pushl $0
c0102977:	6a 00                	push   $0x0
  pushl $225
c0102979:	68 e1 00 00 00       	push   $0xe1
  jmp __alltraps
c010297e:	e9 d4 f6 ff ff       	jmp    c0102057 <__alltraps>

c0102983 <vector226>:
.globl vector226
vector226:
  pushl $0
c0102983:	6a 00                	push   $0x0
  pushl $226
c0102985:	68 e2 00 00 00       	push   $0xe2
  jmp __alltraps
c010298a:	e9 c8 f6 ff ff       	jmp    c0102057 <__alltraps>

c010298f <vector227>:
.globl vector227
vector227:
  pushl $0
c010298f:	6a 00                	push   $0x0
  pushl $227
c0102991:	68 e3 00 00 00       	push   $0xe3
  jmp __alltraps
c0102996:	e9 bc f6 ff ff       	jmp    c0102057 <__alltraps>

c010299b <vector228>:
.globl vector228
vector228:
  pushl $0
c010299b:	6a 00                	push   $0x0
  pushl $228
c010299d:	68 e4 00 00 00       	push   $0xe4
  jmp __alltraps
c01029a2:	e9 b0 f6 ff ff       	jmp    c0102057 <__alltraps>

c01029a7 <vector229>:
.globl vector229
vector229:
  pushl $0
c01029a7:	6a 00                	push   $0x0
  pushl $229
c01029a9:	68 e5 00 00 00       	push   $0xe5
  jmp __alltraps
c01029ae:	e9 a4 f6 ff ff       	jmp    c0102057 <__alltraps>

c01029b3 <vector230>:
.globl vector230
vector230:
  pushl $0
c01029b3:	6a 00                	push   $0x0
  pushl $230
c01029b5:	68 e6 00 00 00       	push   $0xe6
  jmp __alltraps
c01029ba:	e9 98 f6 ff ff       	jmp    c0102057 <__alltraps>

c01029bf <vector231>:
.globl vector231
vector231:
  pushl $0
c01029bf:	6a 00                	push   $0x0
  pushl $231
c01029c1:	68 e7 00 00 00       	push   $0xe7
  jmp __alltraps
c01029c6:	e9 8c f6 ff ff       	jmp    c0102057 <__alltraps>

c01029cb <vector232>:
.globl vector232
vector232:
  pushl $0
c01029cb:	6a 00                	push   $0x0
  pushl $232
c01029cd:	68 e8 00 00 00       	push   $0xe8
  jmp __alltraps
c01029d2:	e9 80 f6 ff ff       	jmp    c0102057 <__alltraps>

c01029d7 <vector233>:
.globl vector233
vector233:
  pushl $0
c01029d7:	6a 00                	push   $0x0
  pushl $233
c01029d9:	68 e9 00 00 00       	push   $0xe9
  jmp __alltraps
c01029de:	e9 74 f6 ff ff       	jmp    c0102057 <__alltraps>

c01029e3 <vector234>:
.globl vector234
vector234:
  pushl $0
c01029e3:	6a 00                	push   $0x0
  pushl $234
c01029e5:	68 ea 00 00 00       	push   $0xea
  jmp __alltraps
c01029ea:	e9 68 f6 ff ff       	jmp    c0102057 <__alltraps>

c01029ef <vector235>:
.globl vector235
vector235:
  pushl $0
c01029ef:	6a 00                	push   $0x0
  pushl $235
c01029f1:	68 eb 00 00 00       	push   $0xeb
  jmp __alltraps
c01029f6:	e9 5c f6 ff ff       	jmp    c0102057 <__alltraps>

c01029fb <vector236>:
.globl vector236
vector236:
  pushl $0
c01029fb:	6a 00                	push   $0x0
  pushl $236
c01029fd:	68 ec 00 00 00       	push   $0xec
  jmp __alltraps
c0102a02:	e9 50 f6 ff ff       	jmp    c0102057 <__alltraps>

c0102a07 <vector237>:
.globl vector237
vector237:
  pushl $0
c0102a07:	6a 00                	push   $0x0
  pushl $237
c0102a09:	68 ed 00 00 00       	push   $0xed
  jmp __alltraps
c0102a0e:	e9 44 f6 ff ff       	jmp    c0102057 <__alltraps>

c0102a13 <vector238>:
.globl vector238
vector238:
  pushl $0
c0102a13:	6a 00                	push   $0x0
  pushl $238
c0102a15:	68 ee 00 00 00       	push   $0xee
  jmp __alltraps
c0102a1a:	e9 38 f6 ff ff       	jmp    c0102057 <__alltraps>

c0102a1f <vector239>:
.globl vector239
vector239:
  pushl $0
c0102a1f:	6a 00                	push   $0x0
  pushl $239
c0102a21:	68 ef 00 00 00       	push   $0xef
  jmp __alltraps
c0102a26:	e9 2c f6 ff ff       	jmp    c0102057 <__alltraps>

c0102a2b <vector240>:
.globl vector240
vector240:
  pushl $0
c0102a2b:	6a 00                	push   $0x0
  pushl $240
c0102a2d:	68 f0 00 00 00       	push   $0xf0
  jmp __alltraps
c0102a32:	e9 20 f6 ff ff       	jmp    c0102057 <__alltraps>

c0102a37 <vector241>:
.globl vector241
vector241:
  pushl $0
c0102a37:	6a 00                	push   $0x0
  pushl $241
c0102a39:	68 f1 00 00 00       	push   $0xf1
  jmp __alltraps
c0102a3e:	e9 14 f6 ff ff       	jmp    c0102057 <__alltraps>

c0102a43 <vector242>:
.globl vector242
vector242:
  pushl $0
c0102a43:	6a 00                	push   $0x0
  pushl $242
c0102a45:	68 f2 00 00 00       	push   $0xf2
  jmp __alltraps
c0102a4a:	e9 08 f6 ff ff       	jmp    c0102057 <__alltraps>

c0102a4f <vector243>:
.globl vector243
vector243:
  pushl $0
c0102a4f:	6a 00                	push   $0x0
  pushl $243
c0102a51:	68 f3 00 00 00       	push   $0xf3
  jmp __alltraps
c0102a56:	e9 fc f5 ff ff       	jmp    c0102057 <__alltraps>

c0102a5b <vector244>:
.globl vector244
vector244:
  pushl $0
c0102a5b:	6a 00                	push   $0x0
  pushl $244
c0102a5d:	68 f4 00 00 00       	push   $0xf4
  jmp __alltraps
c0102a62:	e9 f0 f5 ff ff       	jmp    c0102057 <__alltraps>

c0102a67 <vector245>:
.globl vector245
vector245:
  pushl $0
c0102a67:	6a 00                	push   $0x0
  pushl $245
c0102a69:	68 f5 00 00 00       	push   $0xf5
  jmp __alltraps
c0102a6e:	e9 e4 f5 ff ff       	jmp    c0102057 <__alltraps>

c0102a73 <vector246>:
.globl vector246
vector246:
  pushl $0
c0102a73:	6a 00                	push   $0x0
  pushl $246
c0102a75:	68 f6 00 00 00       	push   $0xf6
  jmp __alltraps
c0102a7a:	e9 d8 f5 ff ff       	jmp    c0102057 <__alltraps>

c0102a7f <vector247>:
.globl vector247
vector247:
  pushl $0
c0102a7f:	6a 00                	push   $0x0
  pushl $247
c0102a81:	68 f7 00 00 00       	push   $0xf7
  jmp __alltraps
c0102a86:	e9 cc f5 ff ff       	jmp    c0102057 <__alltraps>

c0102a8b <vector248>:
.globl vector248
vector248:
  pushl $0
c0102a8b:	6a 00                	push   $0x0
  pushl $248
c0102a8d:	68 f8 00 00 00       	push   $0xf8
  jmp __alltraps
c0102a92:	e9 c0 f5 ff ff       	jmp    c0102057 <__alltraps>

c0102a97 <vector249>:
.globl vector249
vector249:
  pushl $0
c0102a97:	6a 00                	push   $0x0
  pushl $249
c0102a99:	68 f9 00 00 00       	push   $0xf9
  jmp __alltraps
c0102a9e:	e9 b4 f5 ff ff       	jmp    c0102057 <__alltraps>

c0102aa3 <vector250>:
.globl vector250
vector250:
  pushl $0
c0102aa3:	6a 00                	push   $0x0
  pushl $250
c0102aa5:	68 fa 00 00 00       	push   $0xfa
  jmp __alltraps
c0102aaa:	e9 a8 f5 ff ff       	jmp    c0102057 <__alltraps>

c0102aaf <vector251>:
.globl vector251
vector251:
  pushl $0
c0102aaf:	6a 00                	push   $0x0
  pushl $251
c0102ab1:	68 fb 00 00 00       	push   $0xfb
  jmp __alltraps
c0102ab6:	e9 9c f5 ff ff       	jmp    c0102057 <__alltraps>

c0102abb <vector252>:
.globl vector252
vector252:
  pushl $0
c0102abb:	6a 00                	push   $0x0
  pushl $252
c0102abd:	68 fc 00 00 00       	push   $0xfc
  jmp __alltraps
c0102ac2:	e9 90 f5 ff ff       	jmp    c0102057 <__alltraps>

c0102ac7 <vector253>:
.globl vector253
vector253:
  pushl $0
c0102ac7:	6a 00                	push   $0x0
  pushl $253
c0102ac9:	68 fd 00 00 00       	push   $0xfd
  jmp __alltraps
c0102ace:	e9 84 f5 ff ff       	jmp    c0102057 <__alltraps>

c0102ad3 <vector254>:
.globl vector254
vector254:
  pushl $0
c0102ad3:	6a 00                	push   $0x0
  pushl $254
c0102ad5:	68 fe 00 00 00       	push   $0xfe
  jmp __alltraps
c0102ada:	e9 78 f5 ff ff       	jmp    c0102057 <__alltraps>

c0102adf <vector255>:
.globl vector255
vector255:
  pushl $0
c0102adf:	6a 00                	push   $0x0
  pushl $255
c0102ae1:	68 ff 00 00 00       	push   $0xff
  jmp __alltraps
c0102ae6:	e9 6c f5 ff ff       	jmp    c0102057 <__alltraps>

c0102aeb <page2ppn>:

extern struct Page *pages;
extern size_t npage;

static inline ppn_t
page2ppn(struct Page *page) {
c0102aeb:	55                   	push   %ebp
c0102aec:	89 e5                	mov    %esp,%ebp
    return page - pages;
c0102aee:	8b 15 c0 ce 11 c0    	mov    0xc011cec0,%edx
c0102af4:	8b 45 08             	mov    0x8(%ebp),%eax
c0102af7:	29 d0                	sub    %edx,%eax
c0102af9:	c1 f8 02             	sar    $0x2,%eax
c0102afc:	69 c0 cd cc cc cc    	imul   $0xcccccccd,%eax,%eax
}
c0102b02:	5d                   	pop    %ebp
c0102b03:	c3                   	ret    

c0102b04 <page2pa>:

static inline uintptr_t
page2pa(struct Page *page) {
c0102b04:	55                   	push   %ebp
c0102b05:	89 e5                	mov    %esp,%ebp
c0102b07:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
c0102b0a:	8b 45 08             	mov    0x8(%ebp),%eax
c0102b0d:	89 04 24             	mov    %eax,(%esp)
c0102b10:	e8 d6 ff ff ff       	call   c0102aeb <page2ppn>
c0102b15:	c1 e0 0c             	shl    $0xc,%eax
}
c0102b18:	89 ec                	mov    %ebp,%esp
c0102b1a:	5d                   	pop    %ebp
c0102b1b:	c3                   	ret    

c0102b1c <page_ref>:
pde2page(pde_t pde) {
    return pa2page(PDE_ADDR(pde));
}

static inline int
page_ref(struct Page *page) {
c0102b1c:	55                   	push   %ebp
c0102b1d:	89 e5                	mov    %esp,%ebp
    return page->ref;
c0102b1f:	8b 45 08             	mov    0x8(%ebp),%eax
c0102b22:	8b 00                	mov    (%eax),%eax
}
c0102b24:	5d                   	pop    %ebp
c0102b25:	c3                   	ret    

c0102b26 <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
c0102b26:	55                   	push   %ebp
c0102b27:	89 e5                	mov    %esp,%ebp
    page->ref = val;
c0102b29:	8b 45 08             	mov    0x8(%ebp),%eax
c0102b2c:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102b2f:	89 10                	mov    %edx,(%eax)
}
c0102b31:	90                   	nop
c0102b32:	5d                   	pop    %ebp
c0102b33:	c3                   	ret    

c0102b34 <default_init>:

#define free_list (free_area.free_list)
#define nr_free (free_area.nr_free)

static void
default_init(void) {
c0102b34:	55                   	push   %ebp
c0102b35:	89 e5                	mov    %esp,%ebp
c0102b37:	83 ec 10             	sub    $0x10,%esp
c0102b3a:	c7 45 fc a8 ce 11 c0 	movl   $0xc011cea8,-0x4(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
c0102b41:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102b44:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0102b47:	89 50 04             	mov    %edx,0x4(%eax)
c0102b4a:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102b4d:	8b 50 04             	mov    0x4(%eax),%edx
c0102b50:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102b53:	89 10                	mov    %edx,(%eax)
}
c0102b55:	90                   	nop
    list_init(&free_list);
    nr_free = 0;
c0102b56:	c7 05 b0 ce 11 c0 00 	movl   $0x0,0xc011ceb0
c0102b5d:	00 00 00 
}
c0102b60:	90                   	nop
c0102b61:	89 ec                	mov    %ebp,%esp
c0102b63:	5d                   	pop    %ebp
c0102b64:	c3                   	ret    

c0102b65 <default_init_memmap>:

static void
default_init_memmap(struct Page *base, size_t n) {
c0102b65:	55                   	push   %ebp
c0102b66:	89 e5                	mov    %esp,%ebp
c0102b68:	83 ec 58             	sub    $0x58,%esp
    assert(n > 0);
c0102b6b:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0102b6f:	75 24                	jne    c0102b95 <default_init_memmap+0x30>
c0102b71:	c7 44 24 0c 50 67 10 	movl   $0xc0106750,0xc(%esp)
c0102b78:	c0 
c0102b79:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0102b80:	c0 
c0102b81:	c7 44 24 04 6d 00 00 	movl   $0x6d,0x4(%esp)
c0102b88:	00 
c0102b89:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0102b90:	e8 59 e1 ff ff       	call   c0100cee <__panic>
    struct Page *p = base;
c0102b95:	8b 45 08             	mov    0x8(%ebp),%eax
c0102b98:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for (; p != base + n; p ++) {
c0102b9b:	eb 7d                	jmp    c0102c1a <default_init_memmap+0xb5>
        assert(PageReserved(p));
c0102b9d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102ba0:	83 c0 04             	add    $0x4,%eax
c0102ba3:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c0102baa:	89 45 ec             	mov    %eax,-0x14(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0102bad:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0102bb0:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0102bb3:	0f a3 10             	bt     %edx,(%eax)
c0102bb6:	19 c0                	sbb    %eax,%eax
c0102bb8:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return oldbit != 0;
c0102bbb:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0102bbf:	0f 95 c0             	setne  %al
c0102bc2:	0f b6 c0             	movzbl %al,%eax
c0102bc5:	85 c0                	test   %eax,%eax
c0102bc7:	75 24                	jne    c0102bed <default_init_memmap+0x88>
c0102bc9:	c7 44 24 0c 81 67 10 	movl   $0xc0106781,0xc(%esp)
c0102bd0:	c0 
c0102bd1:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0102bd8:	c0 
c0102bd9:	c7 44 24 04 70 00 00 	movl   $0x70,0x4(%esp)
c0102be0:	00 
c0102be1:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0102be8:	e8 01 e1 ff ff       	call   c0100cee <__panic>
        p->flags = p->property = 0;
c0102bed:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102bf0:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
c0102bf7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102bfa:	8b 50 08             	mov    0x8(%eax),%edx
c0102bfd:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102c00:	89 50 04             	mov    %edx,0x4(%eax)
        set_page_ref(p, 0);
c0102c03:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0102c0a:	00 
c0102c0b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102c0e:	89 04 24             	mov    %eax,(%esp)
c0102c11:	e8 10 ff ff ff       	call   c0102b26 <set_page_ref>
    for (; p != base + n; p ++) {
c0102c16:	83 45 f4 14          	addl   $0x14,-0xc(%ebp)
c0102c1a:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102c1d:	89 d0                	mov    %edx,%eax
c0102c1f:	c1 e0 02             	shl    $0x2,%eax
c0102c22:	01 d0                	add    %edx,%eax
c0102c24:	c1 e0 02             	shl    $0x2,%eax
c0102c27:	89 c2                	mov    %eax,%edx
c0102c29:	8b 45 08             	mov    0x8(%ebp),%eax
c0102c2c:	01 d0                	add    %edx,%eax
c0102c2e:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0102c31:	0f 85 66 ff ff ff    	jne    c0102b9d <default_init_memmap+0x38>
    }
    base->property = n;
c0102c37:	8b 45 08             	mov    0x8(%ebp),%eax
c0102c3a:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102c3d:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);
c0102c40:	8b 45 08             	mov    0x8(%ebp),%eax
c0102c43:	83 c0 04             	add    $0x4,%eax
c0102c46:	c7 45 c8 01 00 00 00 	movl   $0x1,-0x38(%ebp)
c0102c4d:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102c50:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0102c53:	8b 55 c8             	mov    -0x38(%ebp),%edx
c0102c56:	0f ab 10             	bts    %edx,(%eax)
}
c0102c59:	90                   	nop
    nr_free += n;
c0102c5a:	8b 15 b0 ce 11 c0    	mov    0xc011ceb0,%edx
c0102c60:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102c63:	01 d0                	add    %edx,%eax
c0102c65:	a3 b0 ce 11 c0       	mov    %eax,0xc011ceb0
    list_add(&free_list, &(base->page_link));
c0102c6a:	8b 45 08             	mov    0x8(%ebp),%eax
c0102c6d:	83 c0 0c             	add    $0xc,%eax
c0102c70:	c7 45 e4 a8 ce 11 c0 	movl   $0xc011cea8,-0x1c(%ebp)
c0102c77:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0102c7a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0102c7d:	89 45 dc             	mov    %eax,-0x24(%ebp)
c0102c80:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0102c83:	89 45 d8             	mov    %eax,-0x28(%ebp)
 * Insert the new element @elm *after* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_after(list_entry_t *listelm, list_entry_t *elm) {
    __list_add(elm, listelm, listelm->next);
c0102c86:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0102c89:	8b 40 04             	mov    0x4(%eax),%eax
c0102c8c:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0102c8f:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0102c92:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0102c95:	89 55 d0             	mov    %edx,-0x30(%ebp)
c0102c98:	89 45 cc             	mov    %eax,-0x34(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
    prev->next = next->prev = elm;
c0102c9b:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0102c9e:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0102ca1:	89 10                	mov    %edx,(%eax)
c0102ca3:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0102ca6:	8b 10                	mov    (%eax),%edx
c0102ca8:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0102cab:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0102cae:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0102cb1:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0102cb4:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0102cb7:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0102cba:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0102cbd:	89 10                	mov    %edx,(%eax)
}
c0102cbf:	90                   	nop
}
c0102cc0:	90                   	nop
}
c0102cc1:	90                   	nop
}
c0102cc2:	90                   	nop
c0102cc3:	89 ec                	mov    %ebp,%esp
c0102cc5:	5d                   	pop    %ebp
c0102cc6:	c3                   	ret    

c0102cc7 <default_alloc_pages>:

static struct Page *
default_alloc_pages(size_t n) {
c0102cc7:	55                   	push   %ebp
c0102cc8:	89 e5                	mov    %esp,%ebp
c0102cca:	83 ec 68             	sub    $0x68,%esp
    assert(n > 0);
c0102ccd:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0102cd1:	75 24                	jne    c0102cf7 <default_alloc_pages+0x30>
c0102cd3:	c7 44 24 0c 50 67 10 	movl   $0xc0106750,0xc(%esp)
c0102cda:	c0 
c0102cdb:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0102ce2:	c0 
c0102ce3:	c7 44 24 04 7c 00 00 	movl   $0x7c,0x4(%esp)
c0102cea:	00 
c0102ceb:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0102cf2:	e8 f7 df ff ff       	call   c0100cee <__panic>
    if (n > nr_free) {
c0102cf7:	a1 b0 ce 11 c0       	mov    0xc011ceb0,%eax
c0102cfc:	39 45 08             	cmp    %eax,0x8(%ebp)
c0102cff:	76 0a                	jbe    c0102d0b <default_alloc_pages+0x44>
        return NULL;
c0102d01:	b8 00 00 00 00       	mov    $0x0,%eax
c0102d06:	e9 34 01 00 00       	jmp    c0102e3f <default_alloc_pages+0x178>
    }
    struct Page *page = NULL;
c0102d0b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    list_entry_t *le = &free_list;
c0102d12:	c7 45 f0 a8 ce 11 c0 	movl   $0xc011cea8,-0x10(%ebp)
    while ((le = list_next(le)) != &free_list) {
c0102d19:	eb 1c                	jmp    c0102d37 <default_alloc_pages+0x70>
        struct Page *p = le2page(le, page_link);
c0102d1b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102d1e:	83 e8 0c             	sub    $0xc,%eax
c0102d21:	89 45 ec             	mov    %eax,-0x14(%ebp)
        if (p->property >= n) {
c0102d24:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0102d27:	8b 40 08             	mov    0x8(%eax),%eax
c0102d2a:	39 45 08             	cmp    %eax,0x8(%ebp)
c0102d2d:	77 08                	ja     c0102d37 <default_alloc_pages+0x70>
            page = p;
c0102d2f:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0102d32:	89 45 f4             	mov    %eax,-0xc(%ebp)
            break;
c0102d35:	eb 18                	jmp    c0102d4f <default_alloc_pages+0x88>
c0102d37:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102d3a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return listelm->next;
c0102d3d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0102d40:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c0102d43:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0102d46:	81 7d f0 a8 ce 11 c0 	cmpl   $0xc011cea8,-0x10(%ebp)
c0102d4d:	75 cc                	jne    c0102d1b <default_alloc_pages+0x54>
        }
    }
    if (page != NULL) {
c0102d4f:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0102d53:	0f 84 e3 00 00 00    	je     c0102e3c <default_alloc_pages+0x175>
        list_del(&(page->page_link));
c0102d59:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102d5c:	83 c0 0c             	add    $0xc,%eax
c0102d5f:	89 45 e0             	mov    %eax,-0x20(%ebp)
    __list_del(listelm->prev, listelm->next);
c0102d62:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0102d65:	8b 40 04             	mov    0x4(%eax),%eax
c0102d68:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0102d6b:	8b 12                	mov    (%edx),%edx
c0102d6d:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0102d70:	89 45 d8             	mov    %eax,-0x28(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_del(list_entry_t *prev, list_entry_t *next) {
    prev->next = next;
c0102d73:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0102d76:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0102d79:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0102d7c:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0102d7f:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0102d82:	89 10                	mov    %edx,(%eax)
}
c0102d84:	90                   	nop
}
c0102d85:	90                   	nop
        if (page->property > n) {
c0102d86:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102d89:	8b 40 08             	mov    0x8(%eax),%eax
c0102d8c:	39 45 08             	cmp    %eax,0x8(%ebp)
c0102d8f:	0f 83 80 00 00 00    	jae    c0102e15 <default_alloc_pages+0x14e>
            struct Page *p = page + n;
c0102d95:	8b 55 08             	mov    0x8(%ebp),%edx
c0102d98:	89 d0                	mov    %edx,%eax
c0102d9a:	c1 e0 02             	shl    $0x2,%eax
c0102d9d:	01 d0                	add    %edx,%eax
c0102d9f:	c1 e0 02             	shl    $0x2,%eax
c0102da2:	89 c2                	mov    %eax,%edx
c0102da4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102da7:	01 d0                	add    %edx,%eax
c0102da9:	89 45 e8             	mov    %eax,-0x18(%ebp)
            p->property = page->property - n;
c0102dac:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102daf:	8b 40 08             	mov    0x8(%eax),%eax
c0102db2:	2b 45 08             	sub    0x8(%ebp),%eax
c0102db5:	89 c2                	mov    %eax,%edx
c0102db7:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0102dba:	89 50 08             	mov    %edx,0x8(%eax)
            list_add(&free_list, &(p->page_link));
c0102dbd:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0102dc0:	83 c0 0c             	add    $0xc,%eax
c0102dc3:	c7 45 d4 a8 ce 11 c0 	movl   $0xc011cea8,-0x2c(%ebp)
c0102dca:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0102dcd:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0102dd0:	89 45 cc             	mov    %eax,-0x34(%ebp)
c0102dd3:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0102dd6:	89 45 c8             	mov    %eax,-0x38(%ebp)
    __list_add(elm, listelm, listelm->next);
c0102dd9:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0102ddc:	8b 40 04             	mov    0x4(%eax),%eax
c0102ddf:	8b 55 c8             	mov    -0x38(%ebp),%edx
c0102de2:	89 55 c4             	mov    %edx,-0x3c(%ebp)
c0102de5:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0102de8:	89 55 c0             	mov    %edx,-0x40(%ebp)
c0102deb:	89 45 bc             	mov    %eax,-0x44(%ebp)
    prev->next = next->prev = elm;
c0102dee:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0102df1:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0102df4:	89 10                	mov    %edx,(%eax)
c0102df6:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0102df9:	8b 10                	mov    (%eax),%edx
c0102dfb:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0102dfe:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0102e01:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0102e04:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0102e07:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0102e0a:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0102e0d:	8b 55 c0             	mov    -0x40(%ebp),%edx
c0102e10:	89 10                	mov    %edx,(%eax)
}
c0102e12:	90                   	nop
}
c0102e13:	90                   	nop
}
c0102e14:	90                   	nop
    }
        nr_free -= n;
c0102e15:	a1 b0 ce 11 c0       	mov    0xc011ceb0,%eax
c0102e1a:	2b 45 08             	sub    0x8(%ebp),%eax
c0102e1d:	a3 b0 ce 11 c0       	mov    %eax,0xc011ceb0
        ClearPageProperty(page);
c0102e22:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e25:	83 c0 04             	add    $0x4,%eax
c0102e28:	c7 45 b8 01 00 00 00 	movl   $0x1,-0x48(%ebp)
c0102e2f:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102e32:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0102e35:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0102e38:	0f b3 10             	btr    %edx,(%eax)
}
c0102e3b:	90                   	nop
    }
    return page;
c0102e3c:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0102e3f:	89 ec                	mov    %ebp,%esp
c0102e41:	5d                   	pop    %ebp
c0102e42:	c3                   	ret    

c0102e43 <default_free_pages>:

static void
default_free_pages(struct Page *base, size_t n) {
c0102e43:	55                   	push   %ebp
c0102e44:	89 e5                	mov    %esp,%ebp
c0102e46:	81 ec 98 00 00 00    	sub    $0x98,%esp
    assert(n > 0);
c0102e4c:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0102e50:	75 24                	jne    c0102e76 <default_free_pages+0x33>
c0102e52:	c7 44 24 0c 50 67 10 	movl   $0xc0106750,0xc(%esp)
c0102e59:	c0 
c0102e5a:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0102e61:	c0 
c0102e62:	c7 44 24 04 98 00 00 	movl   $0x98,0x4(%esp)
c0102e69:	00 
c0102e6a:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0102e71:	e8 78 de ff ff       	call   c0100cee <__panic>
    struct Page *p = base;
c0102e76:	8b 45 08             	mov    0x8(%ebp),%eax
c0102e79:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for (; p != base + n; p ++) {
c0102e7c:	e9 9d 00 00 00       	jmp    c0102f1e <default_free_pages+0xdb>
        assert(!PageReserved(p) && !PageProperty(p));
c0102e81:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e84:	83 c0 04             	add    $0x4,%eax
c0102e87:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0102e8e:	89 45 e8             	mov    %eax,-0x18(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0102e91:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0102e94:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0102e97:	0f a3 10             	bt     %edx,(%eax)
c0102e9a:	19 c0                	sbb    %eax,%eax
c0102e9c:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return oldbit != 0;
c0102e9f:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0102ea3:	0f 95 c0             	setne  %al
c0102ea6:	0f b6 c0             	movzbl %al,%eax
c0102ea9:	85 c0                	test   %eax,%eax
c0102eab:	75 2c                	jne    c0102ed9 <default_free_pages+0x96>
c0102ead:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102eb0:	83 c0 04             	add    $0x4,%eax
c0102eb3:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
c0102eba:	89 45 dc             	mov    %eax,-0x24(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0102ebd:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0102ec0:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0102ec3:	0f a3 10             	bt     %edx,(%eax)
c0102ec6:	19 c0                	sbb    %eax,%eax
c0102ec8:	89 45 d8             	mov    %eax,-0x28(%ebp)
    return oldbit != 0;
c0102ecb:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c0102ecf:	0f 95 c0             	setne  %al
c0102ed2:	0f b6 c0             	movzbl %al,%eax
c0102ed5:	85 c0                	test   %eax,%eax
c0102ed7:	74 24                	je     c0102efd <default_free_pages+0xba>
c0102ed9:	c7 44 24 0c 94 67 10 	movl   $0xc0106794,0xc(%esp)
c0102ee0:	c0 
c0102ee1:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0102ee8:	c0 
c0102ee9:	c7 44 24 04 9b 00 00 	movl   $0x9b,0x4(%esp)
c0102ef0:	00 
c0102ef1:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0102ef8:	e8 f1 dd ff ff       	call   c0100cee <__panic>
        p->flags = 0;
c0102efd:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102f00:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        set_page_ref(p, 0);
c0102f07:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0102f0e:	00 
c0102f0f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102f12:	89 04 24             	mov    %eax,(%esp)
c0102f15:	e8 0c fc ff ff       	call   c0102b26 <set_page_ref>
    for (; p != base + n; p ++) {
c0102f1a:	83 45 f4 14          	addl   $0x14,-0xc(%ebp)
c0102f1e:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102f21:	89 d0                	mov    %edx,%eax
c0102f23:	c1 e0 02             	shl    $0x2,%eax
c0102f26:	01 d0                	add    %edx,%eax
c0102f28:	c1 e0 02             	shl    $0x2,%eax
c0102f2b:	89 c2                	mov    %eax,%edx
c0102f2d:	8b 45 08             	mov    0x8(%ebp),%eax
c0102f30:	01 d0                	add    %edx,%eax
c0102f32:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0102f35:	0f 85 46 ff ff ff    	jne    c0102e81 <default_free_pages+0x3e>
    }
    base->property = n;
c0102f3b:	8b 45 08             	mov    0x8(%ebp),%eax
c0102f3e:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102f41:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);
c0102f44:	8b 45 08             	mov    0x8(%ebp),%eax
c0102f47:	83 c0 04             	add    $0x4,%eax
c0102f4a:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
c0102f51:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102f54:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0102f57:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0102f5a:	0f ab 10             	bts    %edx,(%eax)
}
c0102f5d:	90                   	nop
c0102f5e:	c7 45 d4 a8 ce 11 c0 	movl   $0xc011cea8,-0x2c(%ebp)
    return listelm->next;
c0102f65:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0102f68:	8b 40 04             	mov    0x4(%eax),%eax
    list_entry_t *le = list_next(&free_list);
c0102f6b:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &free_list) {
c0102f6e:	e9 0e 01 00 00       	jmp    c0103081 <default_free_pages+0x23e>
        p = le2page(le, page_link);
c0102f73:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102f76:	83 e8 0c             	sub    $0xc,%eax
c0102f79:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0102f7c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102f7f:	89 45 c8             	mov    %eax,-0x38(%ebp)
c0102f82:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0102f85:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
c0102f88:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (base + base->property == p) {
c0102f8b:	8b 45 08             	mov    0x8(%ebp),%eax
c0102f8e:	8b 50 08             	mov    0x8(%eax),%edx
c0102f91:	89 d0                	mov    %edx,%eax
c0102f93:	c1 e0 02             	shl    $0x2,%eax
c0102f96:	01 d0                	add    %edx,%eax
c0102f98:	c1 e0 02             	shl    $0x2,%eax
c0102f9b:	89 c2                	mov    %eax,%edx
c0102f9d:	8b 45 08             	mov    0x8(%ebp),%eax
c0102fa0:	01 d0                	add    %edx,%eax
c0102fa2:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0102fa5:	75 5d                	jne    c0103004 <default_free_pages+0x1c1>
            base->property += p->property;
c0102fa7:	8b 45 08             	mov    0x8(%ebp),%eax
c0102faa:	8b 50 08             	mov    0x8(%eax),%edx
c0102fad:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102fb0:	8b 40 08             	mov    0x8(%eax),%eax
c0102fb3:	01 c2                	add    %eax,%edx
c0102fb5:	8b 45 08             	mov    0x8(%ebp),%eax
c0102fb8:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(p);
c0102fbb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102fbe:	83 c0 04             	add    $0x4,%eax
c0102fc1:	c7 45 b8 01 00 00 00 	movl   $0x1,-0x48(%ebp)
c0102fc8:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102fcb:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0102fce:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0102fd1:	0f b3 10             	btr    %edx,(%eax)
}
c0102fd4:	90                   	nop
            list_del(&(p->page_link));
c0102fd5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102fd8:	83 c0 0c             	add    $0xc,%eax
c0102fdb:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    __list_del(listelm->prev, listelm->next);
c0102fde:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0102fe1:	8b 40 04             	mov    0x4(%eax),%eax
c0102fe4:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0102fe7:	8b 12                	mov    (%edx),%edx
c0102fe9:	89 55 c0             	mov    %edx,-0x40(%ebp)
c0102fec:	89 45 bc             	mov    %eax,-0x44(%ebp)
    prev->next = next;
c0102fef:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0102ff2:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0102ff5:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0102ff8:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0102ffb:	8b 55 c0             	mov    -0x40(%ebp),%edx
c0102ffe:	89 10                	mov    %edx,(%eax)
}
c0103000:	90                   	nop
}
c0103001:	90                   	nop
c0103002:	eb 7d                	jmp    c0103081 <default_free_pages+0x23e>
        }
        else if (p + p->property == base) {
c0103004:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103007:	8b 50 08             	mov    0x8(%eax),%edx
c010300a:	89 d0                	mov    %edx,%eax
c010300c:	c1 e0 02             	shl    $0x2,%eax
c010300f:	01 d0                	add    %edx,%eax
c0103011:	c1 e0 02             	shl    $0x2,%eax
c0103014:	89 c2                	mov    %eax,%edx
c0103016:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103019:	01 d0                	add    %edx,%eax
c010301b:	39 45 08             	cmp    %eax,0x8(%ebp)
c010301e:	75 61                	jne    c0103081 <default_free_pages+0x23e>
            p->property += base->property;
c0103020:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103023:	8b 50 08             	mov    0x8(%eax),%edx
c0103026:	8b 45 08             	mov    0x8(%ebp),%eax
c0103029:	8b 40 08             	mov    0x8(%eax),%eax
c010302c:	01 c2                	add    %eax,%edx
c010302e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103031:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(base);
c0103034:	8b 45 08             	mov    0x8(%ebp),%eax
c0103037:	83 c0 04             	add    $0x4,%eax
c010303a:	c7 45 a4 01 00 00 00 	movl   $0x1,-0x5c(%ebp)
c0103041:	89 45 a0             	mov    %eax,-0x60(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0103044:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0103047:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c010304a:	0f b3 10             	btr    %edx,(%eax)
}
c010304d:	90                   	nop
            base = p;
c010304e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103051:	89 45 08             	mov    %eax,0x8(%ebp)
            list_del(&(p->page_link));
c0103054:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103057:	83 c0 0c             	add    $0xc,%eax
c010305a:	89 45 b0             	mov    %eax,-0x50(%ebp)
    __list_del(listelm->prev, listelm->next);
c010305d:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0103060:	8b 40 04             	mov    0x4(%eax),%eax
c0103063:	8b 55 b0             	mov    -0x50(%ebp),%edx
c0103066:	8b 12                	mov    (%edx),%edx
c0103068:	89 55 ac             	mov    %edx,-0x54(%ebp)
c010306b:	89 45 a8             	mov    %eax,-0x58(%ebp)
    prev->next = next;
c010306e:	8b 45 ac             	mov    -0x54(%ebp),%eax
c0103071:	8b 55 a8             	mov    -0x58(%ebp),%edx
c0103074:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0103077:	8b 45 a8             	mov    -0x58(%ebp),%eax
c010307a:	8b 55 ac             	mov    -0x54(%ebp),%edx
c010307d:	89 10                	mov    %edx,(%eax)
}
c010307f:	90                   	nop
}
c0103080:	90                   	nop
    while (le != &free_list) {
c0103081:	81 7d f0 a8 ce 11 c0 	cmpl   $0xc011cea8,-0x10(%ebp)
c0103088:	0f 85 e5 fe ff ff    	jne    c0102f73 <default_free_pages+0x130>
        }
    }
    nr_free += n;
c010308e:	8b 15 b0 ce 11 c0    	mov    0xc011ceb0,%edx
c0103094:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103097:	01 d0                	add    %edx,%eax
c0103099:	a3 b0 ce 11 c0       	mov    %eax,0xc011ceb0
    list_add(&free_list, &(base->page_link));
c010309e:	8b 45 08             	mov    0x8(%ebp),%eax
c01030a1:	83 c0 0c             	add    $0xc,%eax
c01030a4:	c7 45 9c a8 ce 11 c0 	movl   $0xc011cea8,-0x64(%ebp)
c01030ab:	89 45 98             	mov    %eax,-0x68(%ebp)
c01030ae:	8b 45 9c             	mov    -0x64(%ebp),%eax
c01030b1:	89 45 94             	mov    %eax,-0x6c(%ebp)
c01030b4:	8b 45 98             	mov    -0x68(%ebp),%eax
c01030b7:	89 45 90             	mov    %eax,-0x70(%ebp)
    __list_add(elm, listelm, listelm->next);
c01030ba:	8b 45 94             	mov    -0x6c(%ebp),%eax
c01030bd:	8b 40 04             	mov    0x4(%eax),%eax
c01030c0:	8b 55 90             	mov    -0x70(%ebp),%edx
c01030c3:	89 55 8c             	mov    %edx,-0x74(%ebp)
c01030c6:	8b 55 94             	mov    -0x6c(%ebp),%edx
c01030c9:	89 55 88             	mov    %edx,-0x78(%ebp)
c01030cc:	89 45 84             	mov    %eax,-0x7c(%ebp)
    prev->next = next->prev = elm;
c01030cf:	8b 45 84             	mov    -0x7c(%ebp),%eax
c01030d2:	8b 55 8c             	mov    -0x74(%ebp),%edx
c01030d5:	89 10                	mov    %edx,(%eax)
c01030d7:	8b 45 84             	mov    -0x7c(%ebp),%eax
c01030da:	8b 10                	mov    (%eax),%edx
c01030dc:	8b 45 88             	mov    -0x78(%ebp),%eax
c01030df:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c01030e2:	8b 45 8c             	mov    -0x74(%ebp),%eax
c01030e5:	8b 55 84             	mov    -0x7c(%ebp),%edx
c01030e8:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c01030eb:	8b 45 8c             	mov    -0x74(%ebp),%eax
c01030ee:	8b 55 88             	mov    -0x78(%ebp),%edx
c01030f1:	89 10                	mov    %edx,(%eax)
}
c01030f3:	90                   	nop
}
c01030f4:	90                   	nop
}
c01030f5:	90                   	nop
}
c01030f6:	90                   	nop
c01030f7:	89 ec                	mov    %ebp,%esp
c01030f9:	5d                   	pop    %ebp
c01030fa:	c3                   	ret    

c01030fb <default_nr_free_pages>:

static size_t
default_nr_free_pages(void) {
c01030fb:	55                   	push   %ebp
c01030fc:	89 e5                	mov    %esp,%ebp
    return nr_free;
c01030fe:	a1 b0 ce 11 c0       	mov    0xc011ceb0,%eax
}
c0103103:	5d                   	pop    %ebp
c0103104:	c3                   	ret    

c0103105 <basic_check>:

static void
basic_check(void) {
c0103105:	55                   	push   %ebp
c0103106:	89 e5                	mov    %esp,%ebp
c0103108:	83 ec 48             	sub    $0x48,%esp
    struct Page *p0, *p1, *p2;
    p0 = p1 = p2 = NULL;
c010310b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0103112:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103115:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103118:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010311b:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert((p0 = alloc_page()) != NULL);
c010311e:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103125:	e8 df 0e 00 00       	call   c0104009 <alloc_pages>
c010312a:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010312d:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0103131:	75 24                	jne    c0103157 <basic_check+0x52>
c0103133:	c7 44 24 0c b9 67 10 	movl   $0xc01067b9,0xc(%esp)
c010313a:	c0 
c010313b:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103142:	c0 
c0103143:	c7 44 24 04 be 00 00 	movl   $0xbe,0x4(%esp)
c010314a:	00 
c010314b:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103152:	e8 97 db ff ff       	call   c0100cee <__panic>
    assert((p1 = alloc_page()) != NULL);
c0103157:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010315e:	e8 a6 0e 00 00       	call   c0104009 <alloc_pages>
c0103163:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103166:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c010316a:	75 24                	jne    c0103190 <basic_check+0x8b>
c010316c:	c7 44 24 0c d5 67 10 	movl   $0xc01067d5,0xc(%esp)
c0103173:	c0 
c0103174:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c010317b:	c0 
c010317c:	c7 44 24 04 bf 00 00 	movl   $0xbf,0x4(%esp)
c0103183:	00 
c0103184:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c010318b:	e8 5e db ff ff       	call   c0100cee <__panic>
    assert((p2 = alloc_page()) != NULL);
c0103190:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103197:	e8 6d 0e 00 00       	call   c0104009 <alloc_pages>
c010319c:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010319f:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01031a3:	75 24                	jne    c01031c9 <basic_check+0xc4>
c01031a5:	c7 44 24 0c f1 67 10 	movl   $0xc01067f1,0xc(%esp)
c01031ac:	c0 
c01031ad:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01031b4:	c0 
c01031b5:	c7 44 24 04 c0 00 00 	movl   $0xc0,0x4(%esp)
c01031bc:	00 
c01031bd:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c01031c4:	e8 25 db ff ff       	call   c0100cee <__panic>

    assert(p0 != p1 && p0 != p2 && p1 != p2);
c01031c9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01031cc:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c01031cf:	74 10                	je     c01031e1 <basic_check+0xdc>
c01031d1:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01031d4:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c01031d7:	74 08                	je     c01031e1 <basic_check+0xdc>
c01031d9:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01031dc:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c01031df:	75 24                	jne    c0103205 <basic_check+0x100>
c01031e1:	c7 44 24 0c 10 68 10 	movl   $0xc0106810,0xc(%esp)
c01031e8:	c0 
c01031e9:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01031f0:	c0 
c01031f1:	c7 44 24 04 c2 00 00 	movl   $0xc2,0x4(%esp)
c01031f8:	00 
c01031f9:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103200:	e8 e9 da ff ff       	call   c0100cee <__panic>
    assert(page_ref(p0) == 0 && page_ref(p1) == 0 && page_ref(p2) == 0);
c0103205:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103208:	89 04 24             	mov    %eax,(%esp)
c010320b:	e8 0c f9 ff ff       	call   c0102b1c <page_ref>
c0103210:	85 c0                	test   %eax,%eax
c0103212:	75 1e                	jne    c0103232 <basic_check+0x12d>
c0103214:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103217:	89 04 24             	mov    %eax,(%esp)
c010321a:	e8 fd f8 ff ff       	call   c0102b1c <page_ref>
c010321f:	85 c0                	test   %eax,%eax
c0103221:	75 0f                	jne    c0103232 <basic_check+0x12d>
c0103223:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103226:	89 04 24             	mov    %eax,(%esp)
c0103229:	e8 ee f8 ff ff       	call   c0102b1c <page_ref>
c010322e:	85 c0                	test   %eax,%eax
c0103230:	74 24                	je     c0103256 <basic_check+0x151>
c0103232:	c7 44 24 0c 34 68 10 	movl   $0xc0106834,0xc(%esp)
c0103239:	c0 
c010323a:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103241:	c0 
c0103242:	c7 44 24 04 c3 00 00 	movl   $0xc3,0x4(%esp)
c0103249:	00 
c010324a:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103251:	e8 98 da ff ff       	call   c0100cee <__panic>

    assert(page2pa(p0) < npage * PGSIZE);
c0103256:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103259:	89 04 24             	mov    %eax,(%esp)
c010325c:	e8 a3 f8 ff ff       	call   c0102b04 <page2pa>
c0103261:	8b 15 c4 ce 11 c0    	mov    0xc011cec4,%edx
c0103267:	c1 e2 0c             	shl    $0xc,%edx
c010326a:	39 d0                	cmp    %edx,%eax
c010326c:	72 24                	jb     c0103292 <basic_check+0x18d>
c010326e:	c7 44 24 0c 70 68 10 	movl   $0xc0106870,0xc(%esp)
c0103275:	c0 
c0103276:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c010327d:	c0 
c010327e:	c7 44 24 04 c5 00 00 	movl   $0xc5,0x4(%esp)
c0103285:	00 
c0103286:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c010328d:	e8 5c da ff ff       	call   c0100cee <__panic>
    assert(page2pa(p1) < npage * PGSIZE);
c0103292:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103295:	89 04 24             	mov    %eax,(%esp)
c0103298:	e8 67 f8 ff ff       	call   c0102b04 <page2pa>
c010329d:	8b 15 c4 ce 11 c0    	mov    0xc011cec4,%edx
c01032a3:	c1 e2 0c             	shl    $0xc,%edx
c01032a6:	39 d0                	cmp    %edx,%eax
c01032a8:	72 24                	jb     c01032ce <basic_check+0x1c9>
c01032aa:	c7 44 24 0c 8d 68 10 	movl   $0xc010688d,0xc(%esp)
c01032b1:	c0 
c01032b2:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01032b9:	c0 
c01032ba:	c7 44 24 04 c6 00 00 	movl   $0xc6,0x4(%esp)
c01032c1:	00 
c01032c2:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c01032c9:	e8 20 da ff ff       	call   c0100cee <__panic>
    assert(page2pa(p2) < npage * PGSIZE);
c01032ce:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01032d1:	89 04 24             	mov    %eax,(%esp)
c01032d4:	e8 2b f8 ff ff       	call   c0102b04 <page2pa>
c01032d9:	8b 15 c4 ce 11 c0    	mov    0xc011cec4,%edx
c01032df:	c1 e2 0c             	shl    $0xc,%edx
c01032e2:	39 d0                	cmp    %edx,%eax
c01032e4:	72 24                	jb     c010330a <basic_check+0x205>
c01032e6:	c7 44 24 0c aa 68 10 	movl   $0xc01068aa,0xc(%esp)
c01032ed:	c0 
c01032ee:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01032f5:	c0 
c01032f6:	c7 44 24 04 c7 00 00 	movl   $0xc7,0x4(%esp)
c01032fd:	00 
c01032fe:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103305:	e8 e4 d9 ff ff       	call   c0100cee <__panic>

    list_entry_t free_list_store = free_list;
c010330a:	a1 a8 ce 11 c0       	mov    0xc011cea8,%eax
c010330f:	8b 15 ac ce 11 c0    	mov    0xc011ceac,%edx
c0103315:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0103318:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c010331b:	c7 45 dc a8 ce 11 c0 	movl   $0xc011cea8,-0x24(%ebp)
    elm->prev = elm->next = elm;
c0103322:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103325:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0103328:	89 50 04             	mov    %edx,0x4(%eax)
c010332b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010332e:	8b 50 04             	mov    0x4(%eax),%edx
c0103331:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103334:	89 10                	mov    %edx,(%eax)
}
c0103336:	90                   	nop
c0103337:	c7 45 e0 a8 ce 11 c0 	movl   $0xc011cea8,-0x20(%ebp)
    return list->next == list;
c010333e:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103341:	8b 40 04             	mov    0x4(%eax),%eax
c0103344:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c0103347:	0f 94 c0             	sete   %al
c010334a:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
c010334d:	85 c0                	test   %eax,%eax
c010334f:	75 24                	jne    c0103375 <basic_check+0x270>
c0103351:	c7 44 24 0c c7 68 10 	movl   $0xc01068c7,0xc(%esp)
c0103358:	c0 
c0103359:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103360:	c0 
c0103361:	c7 44 24 04 cb 00 00 	movl   $0xcb,0x4(%esp)
c0103368:	00 
c0103369:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103370:	e8 79 d9 ff ff       	call   c0100cee <__panic>

    unsigned int nr_free_store = nr_free;
c0103375:	a1 b0 ce 11 c0       	mov    0xc011ceb0,%eax
c010337a:	89 45 e8             	mov    %eax,-0x18(%ebp)
    nr_free = 0;
c010337d:	c7 05 b0 ce 11 c0 00 	movl   $0x0,0xc011ceb0
c0103384:	00 00 00 

    assert(alloc_page() == NULL);
c0103387:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010338e:	e8 76 0c 00 00       	call   c0104009 <alloc_pages>
c0103393:	85 c0                	test   %eax,%eax
c0103395:	74 24                	je     c01033bb <basic_check+0x2b6>
c0103397:	c7 44 24 0c de 68 10 	movl   $0xc01068de,0xc(%esp)
c010339e:	c0 
c010339f:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01033a6:	c0 
c01033a7:	c7 44 24 04 d0 00 00 	movl   $0xd0,0x4(%esp)
c01033ae:	00 
c01033af:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c01033b6:	e8 33 d9 ff ff       	call   c0100cee <__panic>

    free_page(p0);
c01033bb:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01033c2:	00 
c01033c3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01033c6:	89 04 24             	mov    %eax,(%esp)
c01033c9:	e8 75 0c 00 00       	call   c0104043 <free_pages>
    free_page(p1);
c01033ce:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01033d5:	00 
c01033d6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01033d9:	89 04 24             	mov    %eax,(%esp)
c01033dc:	e8 62 0c 00 00       	call   c0104043 <free_pages>
    free_page(p2);
c01033e1:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01033e8:	00 
c01033e9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01033ec:	89 04 24             	mov    %eax,(%esp)
c01033ef:	e8 4f 0c 00 00       	call   c0104043 <free_pages>
    assert(nr_free == 3);
c01033f4:	a1 b0 ce 11 c0       	mov    0xc011ceb0,%eax
c01033f9:	83 f8 03             	cmp    $0x3,%eax
c01033fc:	74 24                	je     c0103422 <basic_check+0x31d>
c01033fe:	c7 44 24 0c f3 68 10 	movl   $0xc01068f3,0xc(%esp)
c0103405:	c0 
c0103406:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c010340d:	c0 
c010340e:	c7 44 24 04 d5 00 00 	movl   $0xd5,0x4(%esp)
c0103415:	00 
c0103416:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c010341d:	e8 cc d8 ff ff       	call   c0100cee <__panic>

    assert((p0 = alloc_page()) != NULL);
c0103422:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103429:	e8 db 0b 00 00       	call   c0104009 <alloc_pages>
c010342e:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0103431:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0103435:	75 24                	jne    c010345b <basic_check+0x356>
c0103437:	c7 44 24 0c b9 67 10 	movl   $0xc01067b9,0xc(%esp)
c010343e:	c0 
c010343f:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103446:	c0 
c0103447:	c7 44 24 04 d7 00 00 	movl   $0xd7,0x4(%esp)
c010344e:	00 
c010344f:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103456:	e8 93 d8 ff ff       	call   c0100cee <__panic>
    assert((p1 = alloc_page()) != NULL);
c010345b:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103462:	e8 a2 0b 00 00       	call   c0104009 <alloc_pages>
c0103467:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010346a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c010346e:	75 24                	jne    c0103494 <basic_check+0x38f>
c0103470:	c7 44 24 0c d5 67 10 	movl   $0xc01067d5,0xc(%esp)
c0103477:	c0 
c0103478:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c010347f:	c0 
c0103480:	c7 44 24 04 d8 00 00 	movl   $0xd8,0x4(%esp)
c0103487:	00 
c0103488:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c010348f:	e8 5a d8 ff ff       	call   c0100cee <__panic>
    assert((p2 = alloc_page()) != NULL);
c0103494:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010349b:	e8 69 0b 00 00       	call   c0104009 <alloc_pages>
c01034a0:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01034a3:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01034a7:	75 24                	jne    c01034cd <basic_check+0x3c8>
c01034a9:	c7 44 24 0c f1 67 10 	movl   $0xc01067f1,0xc(%esp)
c01034b0:	c0 
c01034b1:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01034b8:	c0 
c01034b9:	c7 44 24 04 d9 00 00 	movl   $0xd9,0x4(%esp)
c01034c0:	00 
c01034c1:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c01034c8:	e8 21 d8 ff ff       	call   c0100cee <__panic>

    assert(alloc_page() == NULL);
c01034cd:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01034d4:	e8 30 0b 00 00       	call   c0104009 <alloc_pages>
c01034d9:	85 c0                	test   %eax,%eax
c01034db:	74 24                	je     c0103501 <basic_check+0x3fc>
c01034dd:	c7 44 24 0c de 68 10 	movl   $0xc01068de,0xc(%esp)
c01034e4:	c0 
c01034e5:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01034ec:	c0 
c01034ed:	c7 44 24 04 db 00 00 	movl   $0xdb,0x4(%esp)
c01034f4:	00 
c01034f5:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c01034fc:	e8 ed d7 ff ff       	call   c0100cee <__panic>

    free_page(p0);
c0103501:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103508:	00 
c0103509:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010350c:	89 04 24             	mov    %eax,(%esp)
c010350f:	e8 2f 0b 00 00       	call   c0104043 <free_pages>
c0103514:	c7 45 d8 a8 ce 11 c0 	movl   $0xc011cea8,-0x28(%ebp)
c010351b:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010351e:	8b 40 04             	mov    0x4(%eax),%eax
c0103521:	39 45 d8             	cmp    %eax,-0x28(%ebp)
c0103524:	0f 94 c0             	sete   %al
c0103527:	0f b6 c0             	movzbl %al,%eax
    assert(!list_empty(&free_list));
c010352a:	85 c0                	test   %eax,%eax
c010352c:	74 24                	je     c0103552 <basic_check+0x44d>
c010352e:	c7 44 24 0c 00 69 10 	movl   $0xc0106900,0xc(%esp)
c0103535:	c0 
c0103536:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c010353d:	c0 
c010353e:	c7 44 24 04 de 00 00 	movl   $0xde,0x4(%esp)
c0103545:	00 
c0103546:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c010354d:	e8 9c d7 ff ff       	call   c0100cee <__panic>

    struct Page *p;
    assert((p = alloc_page()) == p0);
c0103552:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103559:	e8 ab 0a 00 00       	call   c0104009 <alloc_pages>
c010355e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0103561:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103564:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0103567:	74 24                	je     c010358d <basic_check+0x488>
c0103569:	c7 44 24 0c 18 69 10 	movl   $0xc0106918,0xc(%esp)
c0103570:	c0 
c0103571:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103578:	c0 
c0103579:	c7 44 24 04 e1 00 00 	movl   $0xe1,0x4(%esp)
c0103580:	00 
c0103581:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103588:	e8 61 d7 ff ff       	call   c0100cee <__panic>
    assert(alloc_page() == NULL);
c010358d:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103594:	e8 70 0a 00 00       	call   c0104009 <alloc_pages>
c0103599:	85 c0                	test   %eax,%eax
c010359b:	74 24                	je     c01035c1 <basic_check+0x4bc>
c010359d:	c7 44 24 0c de 68 10 	movl   $0xc01068de,0xc(%esp)
c01035a4:	c0 
c01035a5:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01035ac:	c0 
c01035ad:	c7 44 24 04 e2 00 00 	movl   $0xe2,0x4(%esp)
c01035b4:	00 
c01035b5:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c01035bc:	e8 2d d7 ff ff       	call   c0100cee <__panic>

    assert(nr_free == 0);
c01035c1:	a1 b0 ce 11 c0       	mov    0xc011ceb0,%eax
c01035c6:	85 c0                	test   %eax,%eax
c01035c8:	74 24                	je     c01035ee <basic_check+0x4e9>
c01035ca:	c7 44 24 0c 31 69 10 	movl   $0xc0106931,0xc(%esp)
c01035d1:	c0 
c01035d2:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01035d9:	c0 
c01035da:	c7 44 24 04 e4 00 00 	movl   $0xe4,0x4(%esp)
c01035e1:	00 
c01035e2:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c01035e9:	e8 00 d7 ff ff       	call   c0100cee <__panic>
    free_list = free_list_store;
c01035ee:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01035f1:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01035f4:	a3 a8 ce 11 c0       	mov    %eax,0xc011cea8
c01035f9:	89 15 ac ce 11 c0    	mov    %edx,0xc011ceac
    nr_free = nr_free_store;
c01035ff:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103602:	a3 b0 ce 11 c0       	mov    %eax,0xc011ceb0

    free_page(p);
c0103607:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010360e:	00 
c010360f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103612:	89 04 24             	mov    %eax,(%esp)
c0103615:	e8 29 0a 00 00       	call   c0104043 <free_pages>
    free_page(p1);
c010361a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103621:	00 
c0103622:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103625:	89 04 24             	mov    %eax,(%esp)
c0103628:	e8 16 0a 00 00       	call   c0104043 <free_pages>
    free_page(p2);
c010362d:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103634:	00 
c0103635:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103638:	89 04 24             	mov    %eax,(%esp)
c010363b:	e8 03 0a 00 00       	call   c0104043 <free_pages>
}
c0103640:	90                   	nop
c0103641:	89 ec                	mov    %ebp,%esp
c0103643:	5d                   	pop    %ebp
c0103644:	c3                   	ret    

c0103645 <default_check>:

// LAB2: below code is used to check the first fit allocation algorithm (your EXERCISE 1) 
// NOTICE: You SHOULD NOT CHANGE basic_check, default_check functions!
static void
default_check(void) {
c0103645:	55                   	push   %ebp
c0103646:	89 e5                	mov    %esp,%ebp
c0103648:	81 ec 98 00 00 00    	sub    $0x98,%esp
    int count = 0, total = 0;
c010364e:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0103655:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    list_entry_t *le = &free_list;
c010365c:	c7 45 ec a8 ce 11 c0 	movl   $0xc011cea8,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
c0103663:	eb 6a                	jmp    c01036cf <default_check+0x8a>
        struct Page *p = le2page(le, page_link);
c0103665:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103668:	83 e8 0c             	sub    $0xc,%eax
c010366b:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        assert(PageProperty(p));
c010366e:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0103671:	83 c0 04             	add    $0x4,%eax
c0103674:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
c010367b:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c010367e:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0103681:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0103684:	0f a3 10             	bt     %edx,(%eax)
c0103687:	19 c0                	sbb    %eax,%eax
c0103689:	89 45 c8             	mov    %eax,-0x38(%ebp)
    return oldbit != 0;
c010368c:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
c0103690:	0f 95 c0             	setne  %al
c0103693:	0f b6 c0             	movzbl %al,%eax
c0103696:	85 c0                	test   %eax,%eax
c0103698:	75 24                	jne    c01036be <default_check+0x79>
c010369a:	c7 44 24 0c 3e 69 10 	movl   $0xc010693e,0xc(%esp)
c01036a1:	c0 
c01036a2:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01036a9:	c0 
c01036aa:	c7 44 24 04 f5 00 00 	movl   $0xf5,0x4(%esp)
c01036b1:	00 
c01036b2:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c01036b9:	e8 30 d6 ff ff       	call   c0100cee <__panic>
        count ++, total += p->property;
c01036be:	ff 45 f4             	incl   -0xc(%ebp)
c01036c1:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01036c4:	8b 50 08             	mov    0x8(%eax),%edx
c01036c7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01036ca:	01 d0                	add    %edx,%eax
c01036cc:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01036cf:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01036d2:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return listelm->next;
c01036d5:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c01036d8:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c01036db:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01036de:	81 7d ec a8 ce 11 c0 	cmpl   $0xc011cea8,-0x14(%ebp)
c01036e5:	0f 85 7a ff ff ff    	jne    c0103665 <default_check+0x20>
    }
    assert(total == nr_free_pages());
c01036eb:	e8 88 09 00 00       	call   c0104078 <nr_free_pages>
c01036f0:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01036f3:	39 d0                	cmp    %edx,%eax
c01036f5:	74 24                	je     c010371b <default_check+0xd6>
c01036f7:	c7 44 24 0c 4e 69 10 	movl   $0xc010694e,0xc(%esp)
c01036fe:	c0 
c01036ff:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103706:	c0 
c0103707:	c7 44 24 04 f8 00 00 	movl   $0xf8,0x4(%esp)
c010370e:	00 
c010370f:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103716:	e8 d3 d5 ff ff       	call   c0100cee <__panic>

    basic_check();
c010371b:	e8 e5 f9 ff ff       	call   c0103105 <basic_check>

    struct Page *p0 = alloc_pages(5), *p1, *p2;
c0103720:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
c0103727:	e8 dd 08 00 00       	call   c0104009 <alloc_pages>
c010372c:	89 45 e8             	mov    %eax,-0x18(%ebp)
    assert(p0 != NULL);
c010372f:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0103733:	75 24                	jne    c0103759 <default_check+0x114>
c0103735:	c7 44 24 0c 67 69 10 	movl   $0xc0106967,0xc(%esp)
c010373c:	c0 
c010373d:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103744:	c0 
c0103745:	c7 44 24 04 fd 00 00 	movl   $0xfd,0x4(%esp)
c010374c:	00 
c010374d:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103754:	e8 95 d5 ff ff       	call   c0100cee <__panic>
    assert(!PageProperty(p0));
c0103759:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010375c:	83 c0 04             	add    $0x4,%eax
c010375f:	c7 45 c0 01 00 00 00 	movl   $0x1,-0x40(%ebp)
c0103766:	89 45 bc             	mov    %eax,-0x44(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103769:	8b 45 bc             	mov    -0x44(%ebp),%eax
c010376c:	8b 55 c0             	mov    -0x40(%ebp),%edx
c010376f:	0f a3 10             	bt     %edx,(%eax)
c0103772:	19 c0                	sbb    %eax,%eax
c0103774:	89 45 b8             	mov    %eax,-0x48(%ebp)
    return oldbit != 0;
c0103777:	83 7d b8 00          	cmpl   $0x0,-0x48(%ebp)
c010377b:	0f 95 c0             	setne  %al
c010377e:	0f b6 c0             	movzbl %al,%eax
c0103781:	85 c0                	test   %eax,%eax
c0103783:	74 24                	je     c01037a9 <default_check+0x164>
c0103785:	c7 44 24 0c 72 69 10 	movl   $0xc0106972,0xc(%esp)
c010378c:	c0 
c010378d:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103794:	c0 
c0103795:	c7 44 24 04 fe 00 00 	movl   $0xfe,0x4(%esp)
c010379c:	00 
c010379d:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c01037a4:	e8 45 d5 ff ff       	call   c0100cee <__panic>

    list_entry_t free_list_store = free_list;
c01037a9:	a1 a8 ce 11 c0       	mov    0xc011cea8,%eax
c01037ae:	8b 15 ac ce 11 c0    	mov    0xc011ceac,%edx
c01037b4:	89 45 80             	mov    %eax,-0x80(%ebp)
c01037b7:	89 55 84             	mov    %edx,-0x7c(%ebp)
c01037ba:	c7 45 b0 a8 ce 11 c0 	movl   $0xc011cea8,-0x50(%ebp)
    elm->prev = elm->next = elm;
c01037c1:	8b 45 b0             	mov    -0x50(%ebp),%eax
c01037c4:	8b 55 b0             	mov    -0x50(%ebp),%edx
c01037c7:	89 50 04             	mov    %edx,0x4(%eax)
c01037ca:	8b 45 b0             	mov    -0x50(%ebp),%eax
c01037cd:	8b 50 04             	mov    0x4(%eax),%edx
c01037d0:	8b 45 b0             	mov    -0x50(%ebp),%eax
c01037d3:	89 10                	mov    %edx,(%eax)
}
c01037d5:	90                   	nop
c01037d6:	c7 45 b4 a8 ce 11 c0 	movl   $0xc011cea8,-0x4c(%ebp)
    return list->next == list;
c01037dd:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c01037e0:	8b 40 04             	mov    0x4(%eax),%eax
c01037e3:	39 45 b4             	cmp    %eax,-0x4c(%ebp)
c01037e6:	0f 94 c0             	sete   %al
c01037e9:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
c01037ec:	85 c0                	test   %eax,%eax
c01037ee:	75 24                	jne    c0103814 <default_check+0x1cf>
c01037f0:	c7 44 24 0c c7 68 10 	movl   $0xc01068c7,0xc(%esp)
c01037f7:	c0 
c01037f8:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01037ff:	c0 
c0103800:	c7 44 24 04 02 01 00 	movl   $0x102,0x4(%esp)
c0103807:	00 
c0103808:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c010380f:	e8 da d4 ff ff       	call   c0100cee <__panic>
    assert(alloc_page() == NULL);
c0103814:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010381b:	e8 e9 07 00 00       	call   c0104009 <alloc_pages>
c0103820:	85 c0                	test   %eax,%eax
c0103822:	74 24                	je     c0103848 <default_check+0x203>
c0103824:	c7 44 24 0c de 68 10 	movl   $0xc01068de,0xc(%esp)
c010382b:	c0 
c010382c:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103833:	c0 
c0103834:	c7 44 24 04 03 01 00 	movl   $0x103,0x4(%esp)
c010383b:	00 
c010383c:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103843:	e8 a6 d4 ff ff       	call   c0100cee <__panic>

    unsigned int nr_free_store = nr_free;
c0103848:	a1 b0 ce 11 c0       	mov    0xc011ceb0,%eax
c010384d:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    nr_free = 0;
c0103850:	c7 05 b0 ce 11 c0 00 	movl   $0x0,0xc011ceb0
c0103857:	00 00 00 

    free_pages(p0 + 2, 3);
c010385a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010385d:	83 c0 28             	add    $0x28,%eax
c0103860:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
c0103867:	00 
c0103868:	89 04 24             	mov    %eax,(%esp)
c010386b:	e8 d3 07 00 00       	call   c0104043 <free_pages>
    assert(alloc_pages(4) == NULL);
c0103870:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
c0103877:	e8 8d 07 00 00       	call   c0104009 <alloc_pages>
c010387c:	85 c0                	test   %eax,%eax
c010387e:	74 24                	je     c01038a4 <default_check+0x25f>
c0103880:	c7 44 24 0c 84 69 10 	movl   $0xc0106984,0xc(%esp)
c0103887:	c0 
c0103888:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c010388f:	c0 
c0103890:	c7 44 24 04 09 01 00 	movl   $0x109,0x4(%esp)
c0103897:	00 
c0103898:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c010389f:	e8 4a d4 ff ff       	call   c0100cee <__panic>
    assert(PageProperty(p0 + 2) && p0[2].property == 3);
c01038a4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01038a7:	83 c0 28             	add    $0x28,%eax
c01038aa:	83 c0 04             	add    $0x4,%eax
c01038ad:	c7 45 ac 01 00 00 00 	movl   $0x1,-0x54(%ebp)
c01038b4:	89 45 a8             	mov    %eax,-0x58(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01038b7:	8b 45 a8             	mov    -0x58(%ebp),%eax
c01038ba:	8b 55 ac             	mov    -0x54(%ebp),%edx
c01038bd:	0f a3 10             	bt     %edx,(%eax)
c01038c0:	19 c0                	sbb    %eax,%eax
c01038c2:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    return oldbit != 0;
c01038c5:	83 7d a4 00          	cmpl   $0x0,-0x5c(%ebp)
c01038c9:	0f 95 c0             	setne  %al
c01038cc:	0f b6 c0             	movzbl %al,%eax
c01038cf:	85 c0                	test   %eax,%eax
c01038d1:	74 0e                	je     c01038e1 <default_check+0x29c>
c01038d3:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01038d6:	83 c0 28             	add    $0x28,%eax
c01038d9:	8b 40 08             	mov    0x8(%eax),%eax
c01038dc:	83 f8 03             	cmp    $0x3,%eax
c01038df:	74 24                	je     c0103905 <default_check+0x2c0>
c01038e1:	c7 44 24 0c 9c 69 10 	movl   $0xc010699c,0xc(%esp)
c01038e8:	c0 
c01038e9:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c01038f0:	c0 
c01038f1:	c7 44 24 04 0a 01 00 	movl   $0x10a,0x4(%esp)
c01038f8:	00 
c01038f9:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103900:	e8 e9 d3 ff ff       	call   c0100cee <__panic>
    assert((p1 = alloc_pages(3)) != NULL);
c0103905:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
c010390c:	e8 f8 06 00 00       	call   c0104009 <alloc_pages>
c0103911:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0103914:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c0103918:	75 24                	jne    c010393e <default_check+0x2f9>
c010391a:	c7 44 24 0c c8 69 10 	movl   $0xc01069c8,0xc(%esp)
c0103921:	c0 
c0103922:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103929:	c0 
c010392a:	c7 44 24 04 0b 01 00 	movl   $0x10b,0x4(%esp)
c0103931:	00 
c0103932:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103939:	e8 b0 d3 ff ff       	call   c0100cee <__panic>
    assert(alloc_page() == NULL);
c010393e:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103945:	e8 bf 06 00 00       	call   c0104009 <alloc_pages>
c010394a:	85 c0                	test   %eax,%eax
c010394c:	74 24                	je     c0103972 <default_check+0x32d>
c010394e:	c7 44 24 0c de 68 10 	movl   $0xc01068de,0xc(%esp)
c0103955:	c0 
c0103956:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c010395d:	c0 
c010395e:	c7 44 24 04 0c 01 00 	movl   $0x10c,0x4(%esp)
c0103965:	00 
c0103966:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c010396d:	e8 7c d3 ff ff       	call   c0100cee <__panic>
    assert(p0 + 2 == p1);
c0103972:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103975:	83 c0 28             	add    $0x28,%eax
c0103978:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c010397b:	74 24                	je     c01039a1 <default_check+0x35c>
c010397d:	c7 44 24 0c e6 69 10 	movl   $0xc01069e6,0xc(%esp)
c0103984:	c0 
c0103985:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c010398c:	c0 
c010398d:	c7 44 24 04 0d 01 00 	movl   $0x10d,0x4(%esp)
c0103994:	00 
c0103995:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c010399c:	e8 4d d3 ff ff       	call   c0100cee <__panic>

    p2 = p0 + 1;
c01039a1:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01039a4:	83 c0 14             	add    $0x14,%eax
c01039a7:	89 45 dc             	mov    %eax,-0x24(%ebp)
    free_page(p0);
c01039aa:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01039b1:	00 
c01039b2:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01039b5:	89 04 24             	mov    %eax,(%esp)
c01039b8:	e8 86 06 00 00       	call   c0104043 <free_pages>
    free_pages(p1, 3);
c01039bd:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
c01039c4:	00 
c01039c5:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01039c8:	89 04 24             	mov    %eax,(%esp)
c01039cb:	e8 73 06 00 00       	call   c0104043 <free_pages>
    assert(PageProperty(p0) && p0->property == 1);
c01039d0:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01039d3:	83 c0 04             	add    $0x4,%eax
c01039d6:	c7 45 a0 01 00 00 00 	movl   $0x1,-0x60(%ebp)
c01039dd:	89 45 9c             	mov    %eax,-0x64(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01039e0:	8b 45 9c             	mov    -0x64(%ebp),%eax
c01039e3:	8b 55 a0             	mov    -0x60(%ebp),%edx
c01039e6:	0f a3 10             	bt     %edx,(%eax)
c01039e9:	19 c0                	sbb    %eax,%eax
c01039eb:	89 45 98             	mov    %eax,-0x68(%ebp)
    return oldbit != 0;
c01039ee:	83 7d 98 00          	cmpl   $0x0,-0x68(%ebp)
c01039f2:	0f 95 c0             	setne  %al
c01039f5:	0f b6 c0             	movzbl %al,%eax
c01039f8:	85 c0                	test   %eax,%eax
c01039fa:	74 0b                	je     c0103a07 <default_check+0x3c2>
c01039fc:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01039ff:	8b 40 08             	mov    0x8(%eax),%eax
c0103a02:	83 f8 01             	cmp    $0x1,%eax
c0103a05:	74 24                	je     c0103a2b <default_check+0x3e6>
c0103a07:	c7 44 24 0c f4 69 10 	movl   $0xc01069f4,0xc(%esp)
c0103a0e:	c0 
c0103a0f:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103a16:	c0 
c0103a17:	c7 44 24 04 12 01 00 	movl   $0x112,0x4(%esp)
c0103a1e:	00 
c0103a1f:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103a26:	e8 c3 d2 ff ff       	call   c0100cee <__panic>
    assert(PageProperty(p1) && p1->property == 3);
c0103a2b:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103a2e:	83 c0 04             	add    $0x4,%eax
c0103a31:	c7 45 94 01 00 00 00 	movl   $0x1,-0x6c(%ebp)
c0103a38:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103a3b:	8b 45 90             	mov    -0x70(%ebp),%eax
c0103a3e:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0103a41:	0f a3 10             	bt     %edx,(%eax)
c0103a44:	19 c0                	sbb    %eax,%eax
c0103a46:	89 45 8c             	mov    %eax,-0x74(%ebp)
    return oldbit != 0;
c0103a49:	83 7d 8c 00          	cmpl   $0x0,-0x74(%ebp)
c0103a4d:	0f 95 c0             	setne  %al
c0103a50:	0f b6 c0             	movzbl %al,%eax
c0103a53:	85 c0                	test   %eax,%eax
c0103a55:	74 0b                	je     c0103a62 <default_check+0x41d>
c0103a57:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103a5a:	8b 40 08             	mov    0x8(%eax),%eax
c0103a5d:	83 f8 03             	cmp    $0x3,%eax
c0103a60:	74 24                	je     c0103a86 <default_check+0x441>
c0103a62:	c7 44 24 0c 1c 6a 10 	movl   $0xc0106a1c,0xc(%esp)
c0103a69:	c0 
c0103a6a:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103a71:	c0 
c0103a72:	c7 44 24 04 13 01 00 	movl   $0x113,0x4(%esp)
c0103a79:	00 
c0103a7a:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103a81:	e8 68 d2 ff ff       	call   c0100cee <__panic>

    assert((p0 = alloc_page()) == p2 - 1);
c0103a86:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103a8d:	e8 77 05 00 00       	call   c0104009 <alloc_pages>
c0103a92:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0103a95:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103a98:	83 e8 14             	sub    $0x14,%eax
c0103a9b:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0103a9e:	74 24                	je     c0103ac4 <default_check+0x47f>
c0103aa0:	c7 44 24 0c 42 6a 10 	movl   $0xc0106a42,0xc(%esp)
c0103aa7:	c0 
c0103aa8:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103aaf:	c0 
c0103ab0:	c7 44 24 04 15 01 00 	movl   $0x115,0x4(%esp)
c0103ab7:	00 
c0103ab8:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103abf:	e8 2a d2 ff ff       	call   c0100cee <__panic>
    free_page(p0);
c0103ac4:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103acb:	00 
c0103acc:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103acf:	89 04 24             	mov    %eax,(%esp)
c0103ad2:	e8 6c 05 00 00       	call   c0104043 <free_pages>
    assert((p0 = alloc_pages(2)) == p2 + 1);
c0103ad7:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
c0103ade:	e8 26 05 00 00       	call   c0104009 <alloc_pages>
c0103ae3:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0103ae6:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103ae9:	83 c0 14             	add    $0x14,%eax
c0103aec:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0103aef:	74 24                	je     c0103b15 <default_check+0x4d0>
c0103af1:	c7 44 24 0c 60 6a 10 	movl   $0xc0106a60,0xc(%esp)
c0103af8:	c0 
c0103af9:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103b00:	c0 
c0103b01:	c7 44 24 04 17 01 00 	movl   $0x117,0x4(%esp)
c0103b08:	00 
c0103b09:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103b10:	e8 d9 d1 ff ff       	call   c0100cee <__panic>

    free_pages(p0, 2);
c0103b15:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
c0103b1c:	00 
c0103b1d:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103b20:	89 04 24             	mov    %eax,(%esp)
c0103b23:	e8 1b 05 00 00       	call   c0104043 <free_pages>
    free_page(p2);
c0103b28:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103b2f:	00 
c0103b30:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103b33:	89 04 24             	mov    %eax,(%esp)
c0103b36:	e8 08 05 00 00       	call   c0104043 <free_pages>

    assert((p0 = alloc_pages(5)) != NULL);
c0103b3b:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
c0103b42:	e8 c2 04 00 00       	call   c0104009 <alloc_pages>
c0103b47:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0103b4a:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0103b4e:	75 24                	jne    c0103b74 <default_check+0x52f>
c0103b50:	c7 44 24 0c 80 6a 10 	movl   $0xc0106a80,0xc(%esp)
c0103b57:	c0 
c0103b58:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103b5f:	c0 
c0103b60:	c7 44 24 04 1c 01 00 	movl   $0x11c,0x4(%esp)
c0103b67:	00 
c0103b68:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103b6f:	e8 7a d1 ff ff       	call   c0100cee <__panic>
    assert(alloc_page() == NULL);
c0103b74:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103b7b:	e8 89 04 00 00       	call   c0104009 <alloc_pages>
c0103b80:	85 c0                	test   %eax,%eax
c0103b82:	74 24                	je     c0103ba8 <default_check+0x563>
c0103b84:	c7 44 24 0c de 68 10 	movl   $0xc01068de,0xc(%esp)
c0103b8b:	c0 
c0103b8c:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103b93:	c0 
c0103b94:	c7 44 24 04 1d 01 00 	movl   $0x11d,0x4(%esp)
c0103b9b:	00 
c0103b9c:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103ba3:	e8 46 d1 ff ff       	call   c0100cee <__panic>

    assert(nr_free == 0);
c0103ba8:	a1 b0 ce 11 c0       	mov    0xc011ceb0,%eax
c0103bad:	85 c0                	test   %eax,%eax
c0103baf:	74 24                	je     c0103bd5 <default_check+0x590>
c0103bb1:	c7 44 24 0c 31 69 10 	movl   $0xc0106931,0xc(%esp)
c0103bb8:	c0 
c0103bb9:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103bc0:	c0 
c0103bc1:	c7 44 24 04 1f 01 00 	movl   $0x11f,0x4(%esp)
c0103bc8:	00 
c0103bc9:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103bd0:	e8 19 d1 ff ff       	call   c0100cee <__panic>
    nr_free = nr_free_store;
c0103bd5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103bd8:	a3 b0 ce 11 c0       	mov    %eax,0xc011ceb0

    free_list = free_list_store;
c0103bdd:	8b 45 80             	mov    -0x80(%ebp),%eax
c0103be0:	8b 55 84             	mov    -0x7c(%ebp),%edx
c0103be3:	a3 a8 ce 11 c0       	mov    %eax,0xc011cea8
c0103be8:	89 15 ac ce 11 c0    	mov    %edx,0xc011ceac
    free_pages(p0, 5);
c0103bee:	c7 44 24 04 05 00 00 	movl   $0x5,0x4(%esp)
c0103bf5:	00 
c0103bf6:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103bf9:	89 04 24             	mov    %eax,(%esp)
c0103bfc:	e8 42 04 00 00       	call   c0104043 <free_pages>

    le = &free_list;
c0103c01:	c7 45 ec a8 ce 11 c0 	movl   $0xc011cea8,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
c0103c08:	eb 5a                	jmp    c0103c64 <default_check+0x61f>
        assert(le->next->prev == le && le->prev->next == le);
c0103c0a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103c0d:	8b 40 04             	mov    0x4(%eax),%eax
c0103c10:	8b 00                	mov    (%eax),%eax
c0103c12:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c0103c15:	75 0d                	jne    c0103c24 <default_check+0x5df>
c0103c17:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103c1a:	8b 00                	mov    (%eax),%eax
c0103c1c:	8b 40 04             	mov    0x4(%eax),%eax
c0103c1f:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c0103c22:	74 24                	je     c0103c48 <default_check+0x603>
c0103c24:	c7 44 24 0c a0 6a 10 	movl   $0xc0106aa0,0xc(%esp)
c0103c2b:	c0 
c0103c2c:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103c33:	c0 
c0103c34:	c7 44 24 04 27 01 00 	movl   $0x127,0x4(%esp)
c0103c3b:	00 
c0103c3c:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103c43:	e8 a6 d0 ff ff       	call   c0100cee <__panic>
        struct Page *p = le2page(le, page_link);
c0103c48:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103c4b:	83 e8 0c             	sub    $0xc,%eax
c0103c4e:	89 45 d8             	mov    %eax,-0x28(%ebp)
        count --, total -= p->property;
c0103c51:	ff 4d f4             	decl   -0xc(%ebp)
c0103c54:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0103c57:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103c5a:	8b 48 08             	mov    0x8(%eax),%ecx
c0103c5d:	89 d0                	mov    %edx,%eax
c0103c5f:	29 c8                	sub    %ecx,%eax
c0103c61:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103c64:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103c67:	89 45 88             	mov    %eax,-0x78(%ebp)
    return listelm->next;
c0103c6a:	8b 45 88             	mov    -0x78(%ebp),%eax
c0103c6d:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c0103c70:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0103c73:	81 7d ec a8 ce 11 c0 	cmpl   $0xc011cea8,-0x14(%ebp)
c0103c7a:	75 8e                	jne    c0103c0a <default_check+0x5c5>
    }
    assert(count == 0);
c0103c7c:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0103c80:	74 24                	je     c0103ca6 <default_check+0x661>
c0103c82:	c7 44 24 0c cd 6a 10 	movl   $0xc0106acd,0xc(%esp)
c0103c89:	c0 
c0103c8a:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103c91:	c0 
c0103c92:	c7 44 24 04 2b 01 00 	movl   $0x12b,0x4(%esp)
c0103c99:	00 
c0103c9a:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103ca1:	e8 48 d0 ff ff       	call   c0100cee <__panic>
    assert(total == 0);
c0103ca6:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0103caa:	74 24                	je     c0103cd0 <default_check+0x68b>
c0103cac:	c7 44 24 0c d8 6a 10 	movl   $0xc0106ad8,0xc(%esp)
c0103cb3:	c0 
c0103cb4:	c7 44 24 08 56 67 10 	movl   $0xc0106756,0x8(%esp)
c0103cbb:	c0 
c0103cbc:	c7 44 24 04 2c 01 00 	movl   $0x12c,0x4(%esp)
c0103cc3:	00 
c0103cc4:	c7 04 24 6b 67 10 c0 	movl   $0xc010676b,(%esp)
c0103ccb:	e8 1e d0 ff ff       	call   c0100cee <__panic>
}
c0103cd0:	90                   	nop
c0103cd1:	89 ec                	mov    %ebp,%esp
c0103cd3:	5d                   	pop    %ebp
c0103cd4:	c3                   	ret    

c0103cd5 <page2ppn>:
page2ppn(struct Page *page) {
c0103cd5:	55                   	push   %ebp
c0103cd6:	89 e5                	mov    %esp,%ebp
    return page - pages;
c0103cd8:	8b 15 c0 ce 11 c0    	mov    0xc011cec0,%edx
c0103cde:	8b 45 08             	mov    0x8(%ebp),%eax
c0103ce1:	29 d0                	sub    %edx,%eax
c0103ce3:	c1 f8 02             	sar    $0x2,%eax
c0103ce6:	69 c0 cd cc cc cc    	imul   $0xcccccccd,%eax,%eax
}
c0103cec:	5d                   	pop    %ebp
c0103ced:	c3                   	ret    

c0103cee <page2pa>:
page2pa(struct Page *page) {
c0103cee:	55                   	push   %ebp
c0103cef:	89 e5                	mov    %esp,%ebp
c0103cf1:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
c0103cf4:	8b 45 08             	mov    0x8(%ebp),%eax
c0103cf7:	89 04 24             	mov    %eax,(%esp)
c0103cfa:	e8 d6 ff ff ff       	call   c0103cd5 <page2ppn>
c0103cff:	c1 e0 0c             	shl    $0xc,%eax
}
c0103d02:	89 ec                	mov    %ebp,%esp
c0103d04:	5d                   	pop    %ebp
c0103d05:	c3                   	ret    

c0103d06 <pa2page>:
pa2page(uintptr_t pa) {
c0103d06:	55                   	push   %ebp
c0103d07:	89 e5                	mov    %esp,%ebp
c0103d09:	83 ec 18             	sub    $0x18,%esp
    if (PPN(pa) >= npage) {
c0103d0c:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d0f:	c1 e8 0c             	shr    $0xc,%eax
c0103d12:	89 c2                	mov    %eax,%edx
c0103d14:	a1 c4 ce 11 c0       	mov    0xc011cec4,%eax
c0103d19:	39 c2                	cmp    %eax,%edx
c0103d1b:	72 1c                	jb     c0103d39 <pa2page+0x33>
        panic("pa2page called with invalid pa");
c0103d1d:	c7 44 24 08 14 6b 10 	movl   $0xc0106b14,0x8(%esp)
c0103d24:	c0 
c0103d25:	c7 44 24 04 5a 00 00 	movl   $0x5a,0x4(%esp)
c0103d2c:	00 
c0103d2d:	c7 04 24 33 6b 10 c0 	movl   $0xc0106b33,(%esp)
c0103d34:	e8 b5 cf ff ff       	call   c0100cee <__panic>
    return &pages[PPN(pa)];
c0103d39:	8b 0d c0 ce 11 c0    	mov    0xc011cec0,%ecx
c0103d3f:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d42:	c1 e8 0c             	shr    $0xc,%eax
c0103d45:	89 c2                	mov    %eax,%edx
c0103d47:	89 d0                	mov    %edx,%eax
c0103d49:	c1 e0 02             	shl    $0x2,%eax
c0103d4c:	01 d0                	add    %edx,%eax
c0103d4e:	c1 e0 02             	shl    $0x2,%eax
c0103d51:	01 c8                	add    %ecx,%eax
}
c0103d53:	89 ec                	mov    %ebp,%esp
c0103d55:	5d                   	pop    %ebp
c0103d56:	c3                   	ret    

c0103d57 <page2kva>:
page2kva(struct Page *page) {
c0103d57:	55                   	push   %ebp
c0103d58:	89 e5                	mov    %esp,%ebp
c0103d5a:	83 ec 28             	sub    $0x28,%esp
    return KADDR(page2pa(page));
c0103d5d:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d60:	89 04 24             	mov    %eax,(%esp)
c0103d63:	e8 86 ff ff ff       	call   c0103cee <page2pa>
c0103d68:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0103d6b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103d6e:	c1 e8 0c             	shr    $0xc,%eax
c0103d71:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103d74:	a1 c4 ce 11 c0       	mov    0xc011cec4,%eax
c0103d79:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0103d7c:	72 23                	jb     c0103da1 <page2kva+0x4a>
c0103d7e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103d81:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0103d85:	c7 44 24 08 44 6b 10 	movl   $0xc0106b44,0x8(%esp)
c0103d8c:	c0 
c0103d8d:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
c0103d94:	00 
c0103d95:	c7 04 24 33 6b 10 c0 	movl   $0xc0106b33,(%esp)
c0103d9c:	e8 4d cf ff ff       	call   c0100cee <__panic>
c0103da1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103da4:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
c0103da9:	89 ec                	mov    %ebp,%esp
c0103dab:	5d                   	pop    %ebp
c0103dac:	c3                   	ret    

c0103dad <pte2page>:
pte2page(pte_t pte) {
c0103dad:	55                   	push   %ebp
c0103dae:	89 e5                	mov    %esp,%ebp
c0103db0:	83 ec 18             	sub    $0x18,%esp
    if (!(pte & PTE_P)) {
c0103db3:	8b 45 08             	mov    0x8(%ebp),%eax
c0103db6:	83 e0 01             	and    $0x1,%eax
c0103db9:	85 c0                	test   %eax,%eax
c0103dbb:	75 1c                	jne    c0103dd9 <pte2page+0x2c>
        panic("pte2page called with invalid pte");
c0103dbd:	c7 44 24 08 68 6b 10 	movl   $0xc0106b68,0x8(%esp)
c0103dc4:	c0 
c0103dc5:	c7 44 24 04 6c 00 00 	movl   $0x6c,0x4(%esp)
c0103dcc:	00 
c0103dcd:	c7 04 24 33 6b 10 c0 	movl   $0xc0106b33,(%esp)
c0103dd4:	e8 15 cf ff ff       	call   c0100cee <__panic>
    return pa2page(PTE_ADDR(pte));
c0103dd9:	8b 45 08             	mov    0x8(%ebp),%eax
c0103ddc:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0103de1:	89 04 24             	mov    %eax,(%esp)
c0103de4:	e8 1d ff ff ff       	call   c0103d06 <pa2page>
}
c0103de9:	89 ec                	mov    %ebp,%esp
c0103deb:	5d                   	pop    %ebp
c0103dec:	c3                   	ret    

c0103ded <pde2page>:
pde2page(pde_t pde) {
c0103ded:	55                   	push   %ebp
c0103dee:	89 e5                	mov    %esp,%ebp
c0103df0:	83 ec 18             	sub    $0x18,%esp
    return pa2page(PDE_ADDR(pde));
c0103df3:	8b 45 08             	mov    0x8(%ebp),%eax
c0103df6:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0103dfb:	89 04 24             	mov    %eax,(%esp)
c0103dfe:	e8 03 ff ff ff       	call   c0103d06 <pa2page>
}
c0103e03:	89 ec                	mov    %ebp,%esp
c0103e05:	5d                   	pop    %ebp
c0103e06:	c3                   	ret    

c0103e07 <page_ref>:
page_ref(struct Page *page) {
c0103e07:	55                   	push   %ebp
c0103e08:	89 e5                	mov    %esp,%ebp
    return page->ref;
c0103e0a:	8b 45 08             	mov    0x8(%ebp),%eax
c0103e0d:	8b 00                	mov    (%eax),%eax
}
c0103e0f:	5d                   	pop    %ebp
c0103e10:	c3                   	ret    

c0103e11 <page_ref_inc>:

static inline int
page_ref_inc(struct Page *page) {
c0103e11:	55                   	push   %ebp
c0103e12:	89 e5                	mov    %esp,%ebp
    page->ref += 1;
c0103e14:	8b 45 08             	mov    0x8(%ebp),%eax
c0103e17:	8b 00                	mov    (%eax),%eax
c0103e19:	8d 50 01             	lea    0x1(%eax),%edx
c0103e1c:	8b 45 08             	mov    0x8(%ebp),%eax
c0103e1f:	89 10                	mov    %edx,(%eax)
    return page->ref;
c0103e21:	8b 45 08             	mov    0x8(%ebp),%eax
c0103e24:	8b 00                	mov    (%eax),%eax
}
c0103e26:	5d                   	pop    %ebp
c0103e27:	c3                   	ret    

c0103e28 <page_ref_dec>:

static inline int
page_ref_dec(struct Page *page) {
c0103e28:	55                   	push   %ebp
c0103e29:	89 e5                	mov    %esp,%ebp
    page->ref -= 1;
c0103e2b:	8b 45 08             	mov    0x8(%ebp),%eax
c0103e2e:	8b 00                	mov    (%eax),%eax
c0103e30:	8d 50 ff             	lea    -0x1(%eax),%edx
c0103e33:	8b 45 08             	mov    0x8(%ebp),%eax
c0103e36:	89 10                	mov    %edx,(%eax)
    return page->ref;
c0103e38:	8b 45 08             	mov    0x8(%ebp),%eax
c0103e3b:	8b 00                	mov    (%eax),%eax
}
c0103e3d:	5d                   	pop    %ebp
c0103e3e:	c3                   	ret    

c0103e3f <__intr_save>:
__intr_save(void) {
c0103e3f:	55                   	push   %ebp
c0103e40:	89 e5                	mov    %esp,%ebp
c0103e42:	83 ec 18             	sub    $0x18,%esp
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0103e45:	9c                   	pushf  
c0103e46:	58                   	pop    %eax
c0103e47:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c0103e4a:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c0103e4d:	25 00 02 00 00       	and    $0x200,%eax
c0103e52:	85 c0                	test   %eax,%eax
c0103e54:	74 0c                	je     c0103e62 <__intr_save+0x23>
        intr_disable();
c0103e56:	e8 ec d8 ff ff       	call   c0101747 <intr_disable>
        return 1;
c0103e5b:	b8 01 00 00 00       	mov    $0x1,%eax
c0103e60:	eb 05                	jmp    c0103e67 <__intr_save+0x28>
    return 0;
c0103e62:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0103e67:	89 ec                	mov    %ebp,%esp
c0103e69:	5d                   	pop    %ebp
c0103e6a:	c3                   	ret    

c0103e6b <__intr_restore>:
__intr_restore(bool flag) {
c0103e6b:	55                   	push   %ebp
c0103e6c:	89 e5                	mov    %esp,%ebp
c0103e6e:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c0103e71:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0103e75:	74 05                	je     c0103e7c <__intr_restore+0x11>
        intr_enable();
c0103e77:	e8 c3 d8 ff ff       	call   c010173f <intr_enable>
}
c0103e7c:	90                   	nop
c0103e7d:	89 ec                	mov    %ebp,%esp
c0103e7f:	5d                   	pop    %ebp
c0103e80:	c3                   	ret    

c0103e81 <lgdt>:
/* *
 * lgdt - load the global descriptor table register and reset the
 * data/code segement registers for kernel.
 * */
static inline void
lgdt(struct pseudodesc *pd) {
c0103e81:	55                   	push   %ebp
c0103e82:	89 e5                	mov    %esp,%ebp
    asm volatile ("lgdt (%0)" :: "r" (pd));
c0103e84:	8b 45 08             	mov    0x8(%ebp),%eax
c0103e87:	0f 01 10             	lgdtl  (%eax)
    asm volatile ("movw %%ax, %%gs" :: "a" (USER_DS));
c0103e8a:	b8 23 00 00 00       	mov    $0x23,%eax
c0103e8f:	8e e8                	mov    %eax,%gs
    asm volatile ("movw %%ax, %%fs" :: "a" (USER_DS));
c0103e91:	b8 23 00 00 00       	mov    $0x23,%eax
c0103e96:	8e e0                	mov    %eax,%fs
    asm volatile ("movw %%ax, %%es" :: "a" (KERNEL_DS));
c0103e98:	b8 10 00 00 00       	mov    $0x10,%eax
c0103e9d:	8e c0                	mov    %eax,%es
    asm volatile ("movw %%ax, %%ds" :: "a" (KERNEL_DS));
c0103e9f:	b8 10 00 00 00       	mov    $0x10,%eax
c0103ea4:	8e d8                	mov    %eax,%ds
    asm volatile ("movw %%ax, %%ss" :: "a" (KERNEL_DS));
c0103ea6:	b8 10 00 00 00       	mov    $0x10,%eax
c0103eab:	8e d0                	mov    %eax,%ss
    // reload cs
    asm volatile ("ljmp %0, $1f\n 1:\n" :: "i" (KERNEL_CS));
c0103ead:	ea b4 3e 10 c0 08 00 	ljmp   $0x8,$0xc0103eb4
}
c0103eb4:	90                   	nop
c0103eb5:	5d                   	pop    %ebp
c0103eb6:	c3                   	ret    

c0103eb7 <load_esp0>:
 * load_esp0 - change the ESP0 in default task state segment,
 * so that we can use different kernel stack when we trap frame
 * user to kernel.
 * */
void
load_esp0(uintptr_t esp0) {
c0103eb7:	55                   	push   %ebp
c0103eb8:	89 e5                	mov    %esp,%ebp
    ts.ts_esp0 = esp0;
c0103eba:	8b 45 08             	mov    0x8(%ebp),%eax
c0103ebd:	a3 e4 ce 11 c0       	mov    %eax,0xc011cee4
}
c0103ec2:	90                   	nop
c0103ec3:	5d                   	pop    %ebp
c0103ec4:	c3                   	ret    

c0103ec5 <gdt_init>:

/* gdt_init - initialize the default GDT and TSS */
static void
gdt_init(void) {
c0103ec5:	55                   	push   %ebp
c0103ec6:	89 e5                	mov    %esp,%ebp
c0103ec8:	83 ec 14             	sub    $0x14,%esp
    // set boot kernel stack and default SS0
    load_esp0((uintptr_t)bootstacktop);
c0103ecb:	b8 00 90 11 c0       	mov    $0xc0119000,%eax
c0103ed0:	89 04 24             	mov    %eax,(%esp)
c0103ed3:	e8 df ff ff ff       	call   c0103eb7 <load_esp0>
    ts.ts_ss0 = KERNEL_DS;
c0103ed8:	66 c7 05 e8 ce 11 c0 	movw   $0x10,0xc011cee8
c0103edf:	10 00 

    // initialize the TSS filed of the gdt
    gdt[SEG_TSS] = SEGTSS(STS_T32A, (uintptr_t)&ts, sizeof(ts), DPL_KERNEL);
c0103ee1:	66 c7 05 28 9a 11 c0 	movw   $0x68,0xc0119a28
c0103ee8:	68 00 
c0103eea:	b8 e0 ce 11 c0       	mov    $0xc011cee0,%eax
c0103eef:	0f b7 c0             	movzwl %ax,%eax
c0103ef2:	66 a3 2a 9a 11 c0    	mov    %ax,0xc0119a2a
c0103ef8:	b8 e0 ce 11 c0       	mov    $0xc011cee0,%eax
c0103efd:	c1 e8 10             	shr    $0x10,%eax
c0103f00:	a2 2c 9a 11 c0       	mov    %al,0xc0119a2c
c0103f05:	0f b6 05 2d 9a 11 c0 	movzbl 0xc0119a2d,%eax
c0103f0c:	24 f0                	and    $0xf0,%al
c0103f0e:	0c 09                	or     $0x9,%al
c0103f10:	a2 2d 9a 11 c0       	mov    %al,0xc0119a2d
c0103f15:	0f b6 05 2d 9a 11 c0 	movzbl 0xc0119a2d,%eax
c0103f1c:	24 ef                	and    $0xef,%al
c0103f1e:	a2 2d 9a 11 c0       	mov    %al,0xc0119a2d
c0103f23:	0f b6 05 2d 9a 11 c0 	movzbl 0xc0119a2d,%eax
c0103f2a:	24 9f                	and    $0x9f,%al
c0103f2c:	a2 2d 9a 11 c0       	mov    %al,0xc0119a2d
c0103f31:	0f b6 05 2d 9a 11 c0 	movzbl 0xc0119a2d,%eax
c0103f38:	0c 80                	or     $0x80,%al
c0103f3a:	a2 2d 9a 11 c0       	mov    %al,0xc0119a2d
c0103f3f:	0f b6 05 2e 9a 11 c0 	movzbl 0xc0119a2e,%eax
c0103f46:	24 f0                	and    $0xf0,%al
c0103f48:	a2 2e 9a 11 c0       	mov    %al,0xc0119a2e
c0103f4d:	0f b6 05 2e 9a 11 c0 	movzbl 0xc0119a2e,%eax
c0103f54:	24 ef                	and    $0xef,%al
c0103f56:	a2 2e 9a 11 c0       	mov    %al,0xc0119a2e
c0103f5b:	0f b6 05 2e 9a 11 c0 	movzbl 0xc0119a2e,%eax
c0103f62:	24 df                	and    $0xdf,%al
c0103f64:	a2 2e 9a 11 c0       	mov    %al,0xc0119a2e
c0103f69:	0f b6 05 2e 9a 11 c0 	movzbl 0xc0119a2e,%eax
c0103f70:	0c 40                	or     $0x40,%al
c0103f72:	a2 2e 9a 11 c0       	mov    %al,0xc0119a2e
c0103f77:	0f b6 05 2e 9a 11 c0 	movzbl 0xc0119a2e,%eax
c0103f7e:	24 7f                	and    $0x7f,%al
c0103f80:	a2 2e 9a 11 c0       	mov    %al,0xc0119a2e
c0103f85:	b8 e0 ce 11 c0       	mov    $0xc011cee0,%eax
c0103f8a:	c1 e8 18             	shr    $0x18,%eax
c0103f8d:	a2 2f 9a 11 c0       	mov    %al,0xc0119a2f

    // reload all segment registers
    lgdt(&gdt_pd);
c0103f92:	c7 04 24 30 9a 11 c0 	movl   $0xc0119a30,(%esp)
c0103f99:	e8 e3 fe ff ff       	call   c0103e81 <lgdt>
c0103f9e:	66 c7 45 fe 28 00    	movw   $0x28,-0x2(%ebp)
    asm volatile ("ltr %0" :: "r" (sel) : "memory");
c0103fa4:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
c0103fa8:	0f 00 d8             	ltr    %ax
}
c0103fab:	90                   	nop

    // load the TSS
    ltr(GD_TSS);
}
c0103fac:	90                   	nop
c0103fad:	89 ec                	mov    %ebp,%esp
c0103faf:	5d                   	pop    %ebp
c0103fb0:	c3                   	ret    

c0103fb1 <init_pmm_manager>:

//init_pmm_manager - initialize a pmm_manager instance
static void
init_pmm_manager(void) {
c0103fb1:	55                   	push   %ebp
c0103fb2:	89 e5                	mov    %esp,%ebp
c0103fb4:	83 ec 18             	sub    $0x18,%esp
    pmm_manager = &default_pmm_manager;
c0103fb7:	c7 05 cc ce 11 c0 f8 	movl   $0xc0106af8,0xc011cecc
c0103fbe:	6a 10 c0 
    cprintf("memory management: %s\n", pmm_manager->name);
c0103fc1:	a1 cc ce 11 c0       	mov    0xc011cecc,%eax
c0103fc6:	8b 00                	mov    (%eax),%eax
c0103fc8:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103fcc:	c7 04 24 94 6b 10 c0 	movl   $0xc0106b94,(%esp)
c0103fd3:	e8 8e c3 ff ff       	call   c0100366 <cprintf>
    pmm_manager->init();
c0103fd8:	a1 cc ce 11 c0       	mov    0xc011cecc,%eax
c0103fdd:	8b 40 04             	mov    0x4(%eax),%eax
c0103fe0:	ff d0                	call   *%eax
}
c0103fe2:	90                   	nop
c0103fe3:	89 ec                	mov    %ebp,%esp
c0103fe5:	5d                   	pop    %ebp
c0103fe6:	c3                   	ret    

c0103fe7 <init_memmap>:

//init_memmap - call pmm->init_memmap to build Page struct for free memory  
static void
init_memmap(struct Page *base, size_t n) {
c0103fe7:	55                   	push   %ebp
c0103fe8:	89 e5                	mov    %esp,%ebp
c0103fea:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->init_memmap(base, n);
c0103fed:	a1 cc ce 11 c0       	mov    0xc011cecc,%eax
c0103ff2:	8b 40 08             	mov    0x8(%eax),%eax
c0103ff5:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103ff8:	89 54 24 04          	mov    %edx,0x4(%esp)
c0103ffc:	8b 55 08             	mov    0x8(%ebp),%edx
c0103fff:	89 14 24             	mov    %edx,(%esp)
c0104002:	ff d0                	call   *%eax
}
c0104004:	90                   	nop
c0104005:	89 ec                	mov    %ebp,%esp
c0104007:	5d                   	pop    %ebp
c0104008:	c3                   	ret    

c0104009 <alloc_pages>:

//alloc_pages - call pmm->alloc_pages to allocate a continuous n*PAGESIZE memory 
struct Page *
alloc_pages(size_t n) {
c0104009:	55                   	push   %ebp
c010400a:	89 e5                	mov    %esp,%ebp
c010400c:	83 ec 28             	sub    $0x28,%esp
    struct Page *page=NULL;
c010400f:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
c0104016:	e8 24 fe ff ff       	call   c0103e3f <__intr_save>
c010401b:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        page = pmm_manager->alloc_pages(n);
c010401e:	a1 cc ce 11 c0       	mov    0xc011cecc,%eax
c0104023:	8b 40 0c             	mov    0xc(%eax),%eax
c0104026:	8b 55 08             	mov    0x8(%ebp),%edx
c0104029:	89 14 24             	mov    %edx,(%esp)
c010402c:	ff d0                	call   *%eax
c010402e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    }
    local_intr_restore(intr_flag);
c0104031:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104034:	89 04 24             	mov    %eax,(%esp)
c0104037:	e8 2f fe ff ff       	call   c0103e6b <__intr_restore>
    return page;
c010403c:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010403f:	89 ec                	mov    %ebp,%esp
c0104041:	5d                   	pop    %ebp
c0104042:	c3                   	ret    

c0104043 <free_pages>:

//free_pages - call pmm->free_pages to free a continuous n*PAGESIZE memory 
void
free_pages(struct Page *base, size_t n) {
c0104043:	55                   	push   %ebp
c0104044:	89 e5                	mov    %esp,%ebp
c0104046:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
c0104049:	e8 f1 fd ff ff       	call   c0103e3f <__intr_save>
c010404e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        pmm_manager->free_pages(base, n);
c0104051:	a1 cc ce 11 c0       	mov    0xc011cecc,%eax
c0104056:	8b 40 10             	mov    0x10(%eax),%eax
c0104059:	8b 55 0c             	mov    0xc(%ebp),%edx
c010405c:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104060:	8b 55 08             	mov    0x8(%ebp),%edx
c0104063:	89 14 24             	mov    %edx,(%esp)
c0104066:	ff d0                	call   *%eax
    }
    local_intr_restore(intr_flag);
c0104068:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010406b:	89 04 24             	mov    %eax,(%esp)
c010406e:	e8 f8 fd ff ff       	call   c0103e6b <__intr_restore>
}
c0104073:	90                   	nop
c0104074:	89 ec                	mov    %ebp,%esp
c0104076:	5d                   	pop    %ebp
c0104077:	c3                   	ret    

c0104078 <nr_free_pages>:

//nr_free_pages - call pmm->nr_free_pages to get the size (nr*PAGESIZE) 
//of current free memory
size_t
nr_free_pages(void) {
c0104078:	55                   	push   %ebp
c0104079:	89 e5                	mov    %esp,%ebp
c010407b:	83 ec 28             	sub    $0x28,%esp
    size_t ret;
    bool intr_flag;
    local_intr_save(intr_flag);
c010407e:	e8 bc fd ff ff       	call   c0103e3f <__intr_save>
c0104083:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        ret = pmm_manager->nr_free_pages();
c0104086:	a1 cc ce 11 c0       	mov    0xc011cecc,%eax
c010408b:	8b 40 14             	mov    0x14(%eax),%eax
c010408e:	ff d0                	call   *%eax
c0104090:	89 45 f0             	mov    %eax,-0x10(%ebp)
    }
    local_intr_restore(intr_flag);
c0104093:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104096:	89 04 24             	mov    %eax,(%esp)
c0104099:	e8 cd fd ff ff       	call   c0103e6b <__intr_restore>
    return ret;
c010409e:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c01040a1:	89 ec                	mov    %ebp,%esp
c01040a3:	5d                   	pop    %ebp
c01040a4:	c3                   	ret    

c01040a5 <page_init>:

/* pmm_init - initialize the physical memory management */
static void
page_init(void) {
c01040a5:	55                   	push   %ebp
c01040a6:	89 e5                	mov    %esp,%ebp
c01040a8:	57                   	push   %edi
c01040a9:	56                   	push   %esi
c01040aa:	53                   	push   %ebx
c01040ab:	81 ec 9c 00 00 00    	sub    $0x9c,%esp
    struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
c01040b1:	c7 45 c4 00 80 00 c0 	movl   $0xc0008000,-0x3c(%ebp)
    uint64_t maxpa = 0;
c01040b8:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
c01040bf:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)

    cprintf("e820map:\n");
c01040c6:	c7 04 24 ab 6b 10 c0 	movl   $0xc0106bab,(%esp)
c01040cd:	e8 94 c2 ff ff       	call   c0100366 <cprintf>
    int i;
    for (i = 0; i < memmap->nr_map; i ++) {
c01040d2:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c01040d9:	e9 0c 01 00 00       	jmp    c01041ea <page_init+0x145>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
c01040de:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c01040e1:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01040e4:	89 d0                	mov    %edx,%eax
c01040e6:	c1 e0 02             	shl    $0x2,%eax
c01040e9:	01 d0                	add    %edx,%eax
c01040eb:	c1 e0 02             	shl    $0x2,%eax
c01040ee:	01 c8                	add    %ecx,%eax
c01040f0:	8b 50 08             	mov    0x8(%eax),%edx
c01040f3:	8b 40 04             	mov    0x4(%eax),%eax
c01040f6:	89 45 a0             	mov    %eax,-0x60(%ebp)
c01040f9:	89 55 a4             	mov    %edx,-0x5c(%ebp)
c01040fc:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c01040ff:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104102:	89 d0                	mov    %edx,%eax
c0104104:	c1 e0 02             	shl    $0x2,%eax
c0104107:	01 d0                	add    %edx,%eax
c0104109:	c1 e0 02             	shl    $0x2,%eax
c010410c:	01 c8                	add    %ecx,%eax
c010410e:	8b 48 0c             	mov    0xc(%eax),%ecx
c0104111:	8b 58 10             	mov    0x10(%eax),%ebx
c0104114:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0104117:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c010411a:	01 c8                	add    %ecx,%eax
c010411c:	11 da                	adc    %ebx,%edx
c010411e:	89 45 98             	mov    %eax,-0x68(%ebp)
c0104121:	89 55 9c             	mov    %edx,-0x64(%ebp)
        cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",
c0104124:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104127:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010412a:	89 d0                	mov    %edx,%eax
c010412c:	c1 e0 02             	shl    $0x2,%eax
c010412f:	01 d0                	add    %edx,%eax
c0104131:	c1 e0 02             	shl    $0x2,%eax
c0104134:	01 c8                	add    %ecx,%eax
c0104136:	83 c0 14             	add    $0x14,%eax
c0104139:	8b 00                	mov    (%eax),%eax
c010413b:	89 85 7c ff ff ff    	mov    %eax,-0x84(%ebp)
c0104141:	8b 45 98             	mov    -0x68(%ebp),%eax
c0104144:	8b 55 9c             	mov    -0x64(%ebp),%edx
c0104147:	83 c0 ff             	add    $0xffffffff,%eax
c010414a:	83 d2 ff             	adc    $0xffffffff,%edx
c010414d:	89 c6                	mov    %eax,%esi
c010414f:	89 d7                	mov    %edx,%edi
c0104151:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104154:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104157:	89 d0                	mov    %edx,%eax
c0104159:	c1 e0 02             	shl    $0x2,%eax
c010415c:	01 d0                	add    %edx,%eax
c010415e:	c1 e0 02             	shl    $0x2,%eax
c0104161:	01 c8                	add    %ecx,%eax
c0104163:	8b 48 0c             	mov    0xc(%eax),%ecx
c0104166:	8b 58 10             	mov    0x10(%eax),%ebx
c0104169:	8b 85 7c ff ff ff    	mov    -0x84(%ebp),%eax
c010416f:	89 44 24 1c          	mov    %eax,0x1c(%esp)
c0104173:	89 74 24 14          	mov    %esi,0x14(%esp)
c0104177:	89 7c 24 18          	mov    %edi,0x18(%esp)
c010417b:	8b 45 a0             	mov    -0x60(%ebp),%eax
c010417e:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c0104181:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104185:	89 54 24 10          	mov    %edx,0x10(%esp)
c0104189:	89 4c 24 04          	mov    %ecx,0x4(%esp)
c010418d:	89 5c 24 08          	mov    %ebx,0x8(%esp)
c0104191:	c7 04 24 b8 6b 10 c0 	movl   $0xc0106bb8,(%esp)
c0104198:	e8 c9 c1 ff ff       	call   c0100366 <cprintf>
                memmap->map[i].size, begin, end - 1, memmap->map[i].type);
        if (memmap->map[i].type == E820_ARM) {
c010419d:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c01041a0:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01041a3:	89 d0                	mov    %edx,%eax
c01041a5:	c1 e0 02             	shl    $0x2,%eax
c01041a8:	01 d0                	add    %edx,%eax
c01041aa:	c1 e0 02             	shl    $0x2,%eax
c01041ad:	01 c8                	add    %ecx,%eax
c01041af:	83 c0 14             	add    $0x14,%eax
c01041b2:	8b 00                	mov    (%eax),%eax
c01041b4:	83 f8 01             	cmp    $0x1,%eax
c01041b7:	75 2e                	jne    c01041e7 <page_init+0x142>
            if (maxpa < end && begin < KMEMSIZE) {
c01041b9:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01041bc:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01041bf:	3b 45 98             	cmp    -0x68(%ebp),%eax
c01041c2:	89 d0                	mov    %edx,%eax
c01041c4:	1b 45 9c             	sbb    -0x64(%ebp),%eax
c01041c7:	73 1e                	jae    c01041e7 <page_init+0x142>
c01041c9:	ba ff ff ff 37       	mov    $0x37ffffff,%edx
c01041ce:	b8 00 00 00 00       	mov    $0x0,%eax
c01041d3:	3b 55 a0             	cmp    -0x60(%ebp),%edx
c01041d6:	1b 45 a4             	sbb    -0x5c(%ebp),%eax
c01041d9:	72 0c                	jb     c01041e7 <page_init+0x142>
                maxpa = end;
c01041db:	8b 45 98             	mov    -0x68(%ebp),%eax
c01041de:	8b 55 9c             	mov    -0x64(%ebp),%edx
c01041e1:	89 45 e0             	mov    %eax,-0x20(%ebp)
c01041e4:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    for (i = 0; i < memmap->nr_map; i ++) {
c01041e7:	ff 45 dc             	incl   -0x24(%ebp)
c01041ea:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c01041ed:	8b 00                	mov    (%eax),%eax
c01041ef:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c01041f2:	0f 8c e6 fe ff ff    	jl     c01040de <page_init+0x39>
            }
        }
    }
    if (maxpa > KMEMSIZE) {
c01041f8:	ba 00 00 00 38       	mov    $0x38000000,%edx
c01041fd:	b8 00 00 00 00       	mov    $0x0,%eax
c0104202:	3b 55 e0             	cmp    -0x20(%ebp),%edx
c0104205:	1b 45 e4             	sbb    -0x1c(%ebp),%eax
c0104208:	73 0e                	jae    c0104218 <page_init+0x173>
        maxpa = KMEMSIZE;
c010420a:	c7 45 e0 00 00 00 38 	movl   $0x38000000,-0x20(%ebp)
c0104211:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    }

    extern char end[];

    npage = maxpa / PGSIZE;
c0104218:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010421b:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c010421e:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c0104222:	c1 ea 0c             	shr    $0xc,%edx
c0104225:	a3 c4 ce 11 c0       	mov    %eax,0xc011cec4
    pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);
c010422a:	c7 45 c0 00 10 00 00 	movl   $0x1000,-0x40(%ebp)
c0104231:	b8 4c cf 11 c0       	mov    $0xc011cf4c,%eax
c0104236:	8d 50 ff             	lea    -0x1(%eax),%edx
c0104239:	8b 45 c0             	mov    -0x40(%ebp),%eax
c010423c:	01 d0                	add    %edx,%eax
c010423e:	89 45 bc             	mov    %eax,-0x44(%ebp)
c0104241:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0104244:	ba 00 00 00 00       	mov    $0x0,%edx
c0104249:	f7 75 c0             	divl   -0x40(%ebp)
c010424c:	8b 45 bc             	mov    -0x44(%ebp),%eax
c010424f:	29 d0                	sub    %edx,%eax
c0104251:	a3 c0 ce 11 c0       	mov    %eax,0xc011cec0

    for (i = 0; i < npage; i ++) {
c0104256:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c010425d:	eb 2f                	jmp    c010428e <page_init+0x1e9>
        SetPageReserved(pages + i);
c010425f:	8b 0d c0 ce 11 c0    	mov    0xc011cec0,%ecx
c0104265:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104268:	89 d0                	mov    %edx,%eax
c010426a:	c1 e0 02             	shl    $0x2,%eax
c010426d:	01 d0                	add    %edx,%eax
c010426f:	c1 e0 02             	shl    $0x2,%eax
c0104272:	01 c8                	add    %ecx,%eax
c0104274:	83 c0 04             	add    $0x4,%eax
c0104277:	c7 45 94 00 00 00 00 	movl   $0x0,-0x6c(%ebp)
c010427e:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0104281:	8b 45 90             	mov    -0x70(%ebp),%eax
c0104284:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0104287:	0f ab 10             	bts    %edx,(%eax)
}
c010428a:	90                   	nop
    for (i = 0; i < npage; i ++) {
c010428b:	ff 45 dc             	incl   -0x24(%ebp)
c010428e:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104291:	a1 c4 ce 11 c0       	mov    0xc011cec4,%eax
c0104296:	39 c2                	cmp    %eax,%edx
c0104298:	72 c5                	jb     c010425f <page_init+0x1ba>
    }

    uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);
c010429a:	8b 15 c4 ce 11 c0    	mov    0xc011cec4,%edx
c01042a0:	89 d0                	mov    %edx,%eax
c01042a2:	c1 e0 02             	shl    $0x2,%eax
c01042a5:	01 d0                	add    %edx,%eax
c01042a7:	c1 e0 02             	shl    $0x2,%eax
c01042aa:	89 c2                	mov    %eax,%edx
c01042ac:	a1 c0 ce 11 c0       	mov    0xc011cec0,%eax
c01042b1:	01 d0                	add    %edx,%eax
c01042b3:	89 45 b8             	mov    %eax,-0x48(%ebp)
c01042b6:	81 7d b8 ff ff ff bf 	cmpl   $0xbfffffff,-0x48(%ebp)
c01042bd:	77 23                	ja     c01042e2 <page_init+0x23d>
c01042bf:	8b 45 b8             	mov    -0x48(%ebp),%eax
c01042c2:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01042c6:	c7 44 24 08 e8 6b 10 	movl   $0xc0106be8,0x8(%esp)
c01042cd:	c0 
c01042ce:	c7 44 24 04 dc 00 00 	movl   $0xdc,0x4(%esp)
c01042d5:	00 
c01042d6:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c01042dd:	e8 0c ca ff ff       	call   c0100cee <__panic>
c01042e2:	8b 45 b8             	mov    -0x48(%ebp),%eax
c01042e5:	05 00 00 00 40       	add    $0x40000000,%eax
c01042ea:	89 45 b4             	mov    %eax,-0x4c(%ebp)

    for (i = 0; i < memmap->nr_map; i ++) {
c01042ed:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c01042f4:	e9 53 01 00 00       	jmp    c010444c <page_init+0x3a7>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
c01042f9:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c01042fc:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01042ff:	89 d0                	mov    %edx,%eax
c0104301:	c1 e0 02             	shl    $0x2,%eax
c0104304:	01 d0                	add    %edx,%eax
c0104306:	c1 e0 02             	shl    $0x2,%eax
c0104309:	01 c8                	add    %ecx,%eax
c010430b:	8b 50 08             	mov    0x8(%eax),%edx
c010430e:	8b 40 04             	mov    0x4(%eax),%eax
c0104311:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0104314:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0104317:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c010431a:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010431d:	89 d0                	mov    %edx,%eax
c010431f:	c1 e0 02             	shl    $0x2,%eax
c0104322:	01 d0                	add    %edx,%eax
c0104324:	c1 e0 02             	shl    $0x2,%eax
c0104327:	01 c8                	add    %ecx,%eax
c0104329:	8b 48 0c             	mov    0xc(%eax),%ecx
c010432c:	8b 58 10             	mov    0x10(%eax),%ebx
c010432f:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104332:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0104335:	01 c8                	add    %ecx,%eax
c0104337:	11 da                	adc    %ebx,%edx
c0104339:	89 45 c8             	mov    %eax,-0x38(%ebp)
c010433c:	89 55 cc             	mov    %edx,-0x34(%ebp)
        if (memmap->map[i].type == E820_ARM) {
c010433f:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104342:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104345:	89 d0                	mov    %edx,%eax
c0104347:	c1 e0 02             	shl    $0x2,%eax
c010434a:	01 d0                	add    %edx,%eax
c010434c:	c1 e0 02             	shl    $0x2,%eax
c010434f:	01 c8                	add    %ecx,%eax
c0104351:	83 c0 14             	add    $0x14,%eax
c0104354:	8b 00                	mov    (%eax),%eax
c0104356:	83 f8 01             	cmp    $0x1,%eax
c0104359:	0f 85 ea 00 00 00    	jne    c0104449 <page_init+0x3a4>
            if (begin < freemem) {
c010435f:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0104362:	ba 00 00 00 00       	mov    $0x0,%edx
c0104367:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c010436a:	39 45 d0             	cmp    %eax,-0x30(%ebp)
c010436d:	19 d1                	sbb    %edx,%ecx
c010436f:	73 0d                	jae    c010437e <page_init+0x2d9>
                begin = freemem;
c0104371:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0104374:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0104377:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
            }
            if (end > KMEMSIZE) {
c010437e:	ba 00 00 00 38       	mov    $0x38000000,%edx
c0104383:	b8 00 00 00 00       	mov    $0x0,%eax
c0104388:	3b 55 c8             	cmp    -0x38(%ebp),%edx
c010438b:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c010438e:	73 0e                	jae    c010439e <page_init+0x2f9>
                end = KMEMSIZE;
c0104390:	c7 45 c8 00 00 00 38 	movl   $0x38000000,-0x38(%ebp)
c0104397:	c7 45 cc 00 00 00 00 	movl   $0x0,-0x34(%ebp)
            }
            if (begin < end) {
c010439e:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01043a1:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01043a4:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c01043a7:	89 d0                	mov    %edx,%eax
c01043a9:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c01043ac:	0f 83 97 00 00 00    	jae    c0104449 <page_init+0x3a4>
                begin = ROUNDUP(begin, PGSIZE);
c01043b2:	c7 45 b0 00 10 00 00 	movl   $0x1000,-0x50(%ebp)
c01043b9:	8b 55 d0             	mov    -0x30(%ebp),%edx
c01043bc:	8b 45 b0             	mov    -0x50(%ebp),%eax
c01043bf:	01 d0                	add    %edx,%eax
c01043c1:	48                   	dec    %eax
c01043c2:	89 45 ac             	mov    %eax,-0x54(%ebp)
c01043c5:	8b 45 ac             	mov    -0x54(%ebp),%eax
c01043c8:	ba 00 00 00 00       	mov    $0x0,%edx
c01043cd:	f7 75 b0             	divl   -0x50(%ebp)
c01043d0:	8b 45 ac             	mov    -0x54(%ebp),%eax
c01043d3:	29 d0                	sub    %edx,%eax
c01043d5:	ba 00 00 00 00       	mov    $0x0,%edx
c01043da:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01043dd:	89 55 d4             	mov    %edx,-0x2c(%ebp)
                end = ROUNDDOWN(end, PGSIZE);
c01043e0:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01043e3:	89 45 a8             	mov    %eax,-0x58(%ebp)
c01043e6:	8b 45 a8             	mov    -0x58(%ebp),%eax
c01043e9:	ba 00 00 00 00       	mov    $0x0,%edx
c01043ee:	89 c7                	mov    %eax,%edi
c01043f0:	81 e7 00 f0 ff ff    	and    $0xfffff000,%edi
c01043f6:	89 7d 80             	mov    %edi,-0x80(%ebp)
c01043f9:	89 d0                	mov    %edx,%eax
c01043fb:	83 e0 00             	and    $0x0,%eax
c01043fe:	89 45 84             	mov    %eax,-0x7c(%ebp)
c0104401:	8b 45 80             	mov    -0x80(%ebp),%eax
c0104404:	8b 55 84             	mov    -0x7c(%ebp),%edx
c0104407:	89 45 c8             	mov    %eax,-0x38(%ebp)
c010440a:	89 55 cc             	mov    %edx,-0x34(%ebp)
                if (begin < end) {
c010440d:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104410:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0104413:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c0104416:	89 d0                	mov    %edx,%eax
c0104418:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c010441b:	73 2c                	jae    c0104449 <page_init+0x3a4>
                    init_memmap(pa2page(begin), (end - begin) / PGSIZE);
c010441d:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0104420:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0104423:	2b 45 d0             	sub    -0x30(%ebp),%eax
c0104426:	1b 55 d4             	sbb    -0x2c(%ebp),%edx
c0104429:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c010442d:	c1 ea 0c             	shr    $0xc,%edx
c0104430:	89 c3                	mov    %eax,%ebx
c0104432:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104435:	89 04 24             	mov    %eax,(%esp)
c0104438:	e8 c9 f8 ff ff       	call   c0103d06 <pa2page>
c010443d:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c0104441:	89 04 24             	mov    %eax,(%esp)
c0104444:	e8 9e fb ff ff       	call   c0103fe7 <init_memmap>
    for (i = 0; i < memmap->nr_map; i ++) {
c0104449:	ff 45 dc             	incl   -0x24(%ebp)
c010444c:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010444f:	8b 00                	mov    (%eax),%eax
c0104451:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c0104454:	0f 8c 9f fe ff ff    	jl     c01042f9 <page_init+0x254>
                }
            }
        }
    }
}
c010445a:	90                   	nop
c010445b:	90                   	nop
c010445c:	81 c4 9c 00 00 00    	add    $0x9c,%esp
c0104462:	5b                   	pop    %ebx
c0104463:	5e                   	pop    %esi
c0104464:	5f                   	pop    %edi
c0104465:	5d                   	pop    %ebp
c0104466:	c3                   	ret    

c0104467 <boot_map_segment>:
//  la:   linear address of this memory need to map (after x86 segment map)
//  size: memory size
//  pa:   physical address of this memory
//  perm: permission of this memory  
static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
c0104467:	55                   	push   %ebp
c0104468:	89 e5                	mov    %esp,%ebp
c010446a:	83 ec 38             	sub    $0x38,%esp
    assert(PGOFF(la) == PGOFF(pa));
c010446d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104470:	33 45 14             	xor    0x14(%ebp),%eax
c0104473:	25 ff 0f 00 00       	and    $0xfff,%eax
c0104478:	85 c0                	test   %eax,%eax
c010447a:	74 24                	je     c01044a0 <boot_map_segment+0x39>
c010447c:	c7 44 24 0c 1a 6c 10 	movl   $0xc0106c1a,0xc(%esp)
c0104483:	c0 
c0104484:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c010448b:	c0 
c010448c:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
c0104493:	00 
c0104494:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c010449b:	e8 4e c8 ff ff       	call   c0100cee <__panic>
    size_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
c01044a0:	c7 45 f0 00 10 00 00 	movl   $0x1000,-0x10(%ebp)
c01044a7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01044aa:	25 ff 0f 00 00       	and    $0xfff,%eax
c01044af:	89 c2                	mov    %eax,%edx
c01044b1:	8b 45 10             	mov    0x10(%ebp),%eax
c01044b4:	01 c2                	add    %eax,%edx
c01044b6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01044b9:	01 d0                	add    %edx,%eax
c01044bb:	48                   	dec    %eax
c01044bc:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01044bf:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01044c2:	ba 00 00 00 00       	mov    $0x0,%edx
c01044c7:	f7 75 f0             	divl   -0x10(%ebp)
c01044ca:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01044cd:	29 d0                	sub    %edx,%eax
c01044cf:	c1 e8 0c             	shr    $0xc,%eax
c01044d2:	89 45 f4             	mov    %eax,-0xc(%ebp)
    la = ROUNDDOWN(la, PGSIZE);
c01044d5:	8b 45 0c             	mov    0xc(%ebp),%eax
c01044d8:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01044db:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01044de:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c01044e3:	89 45 0c             	mov    %eax,0xc(%ebp)
    pa = ROUNDDOWN(pa, PGSIZE);
c01044e6:	8b 45 14             	mov    0x14(%ebp),%eax
c01044e9:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01044ec:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01044ef:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c01044f4:	89 45 14             	mov    %eax,0x14(%ebp)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c01044f7:	eb 68                	jmp    c0104561 <boot_map_segment+0xfa>
        pte_t *ptep = get_pte(pgdir, la, 1);
c01044f9:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
c0104500:	00 
c0104501:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104504:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104508:	8b 45 08             	mov    0x8(%ebp),%eax
c010450b:	89 04 24             	mov    %eax,(%esp)
c010450e:	e8 88 01 00 00       	call   c010469b <get_pte>
c0104513:	89 45 e0             	mov    %eax,-0x20(%ebp)
        assert(ptep != NULL);
c0104516:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c010451a:	75 24                	jne    c0104540 <boot_map_segment+0xd9>
c010451c:	c7 44 24 0c 46 6c 10 	movl   $0xc0106c46,0xc(%esp)
c0104523:	c0 
c0104524:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c010452b:	c0 
c010452c:	c7 44 24 04 00 01 00 	movl   $0x100,0x4(%esp)
c0104533:	00 
c0104534:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c010453b:	e8 ae c7 ff ff       	call   c0100cee <__panic>
        *ptep = pa | PTE_P | perm;
c0104540:	8b 45 14             	mov    0x14(%ebp),%eax
c0104543:	0b 45 18             	or     0x18(%ebp),%eax
c0104546:	83 c8 01             	or     $0x1,%eax
c0104549:	89 c2                	mov    %eax,%edx
c010454b:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010454e:	89 10                	mov    %edx,(%eax)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c0104550:	ff 4d f4             	decl   -0xc(%ebp)
c0104553:	81 45 0c 00 10 00 00 	addl   $0x1000,0xc(%ebp)
c010455a:	81 45 14 00 10 00 00 	addl   $0x1000,0x14(%ebp)
c0104561:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104565:	75 92                	jne    c01044f9 <boot_map_segment+0x92>
    }
}
c0104567:	90                   	nop
c0104568:	90                   	nop
c0104569:	89 ec                	mov    %ebp,%esp
c010456b:	5d                   	pop    %ebp
c010456c:	c3                   	ret    

c010456d <boot_alloc_page>:

//boot_alloc_page - allocate one page using pmm->alloc_pages(1) 
// return value: the kernel virtual address of this allocated page
//note: this function is used to get the memory for PDT(Page Directory Table)&PT(Page Table)
static void *
boot_alloc_page(void) {
c010456d:	55                   	push   %ebp
c010456e:	89 e5                	mov    %esp,%ebp
c0104570:	83 ec 28             	sub    $0x28,%esp
    struct Page *p = alloc_page();
c0104573:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010457a:	e8 8a fa ff ff       	call   c0104009 <alloc_pages>
c010457f:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (p == NULL) {
c0104582:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104586:	75 1c                	jne    c01045a4 <boot_alloc_page+0x37>
        panic("boot_alloc_page failed.\n");
c0104588:	c7 44 24 08 53 6c 10 	movl   $0xc0106c53,0x8(%esp)
c010458f:	c0 
c0104590:	c7 44 24 04 0c 01 00 	movl   $0x10c,0x4(%esp)
c0104597:	00 
c0104598:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c010459f:	e8 4a c7 ff ff       	call   c0100cee <__panic>
    }
    return page2kva(p);
c01045a4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01045a7:	89 04 24             	mov    %eax,(%esp)
c01045aa:	e8 a8 f7 ff ff       	call   c0103d57 <page2kva>
}
c01045af:	89 ec                	mov    %ebp,%esp
c01045b1:	5d                   	pop    %ebp
c01045b2:	c3                   	ret    

c01045b3 <pmm_init>:

//pmm_init - setup a pmm to manage physical memory, build PDT&PT to setup paging mechanism 
//         - check the correctness of pmm & paging mechanism, print PDT&PT
void
pmm_init(void) {
c01045b3:	55                   	push   %ebp
c01045b4:	89 e5                	mov    %esp,%ebp
c01045b6:	83 ec 38             	sub    $0x38,%esp
    // We've already enabled paging
    boot_cr3 = PADDR(boot_pgdir);
c01045b9:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c01045be:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01045c1:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c01045c8:	77 23                	ja     c01045ed <pmm_init+0x3a>
c01045ca:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01045cd:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01045d1:	c7 44 24 08 e8 6b 10 	movl   $0xc0106be8,0x8(%esp)
c01045d8:	c0 
c01045d9:	c7 44 24 04 16 01 00 	movl   $0x116,0x4(%esp)
c01045e0:	00 
c01045e1:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c01045e8:	e8 01 c7 ff ff       	call   c0100cee <__panic>
c01045ed:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01045f0:	05 00 00 00 40       	add    $0x40000000,%eax
c01045f5:	a3 c8 ce 11 c0       	mov    %eax,0xc011cec8
    //We need to alloc/free the physical memory (granularity is 4KB or other size). 
    //So a framework of physical memory manager (struct pmm_manager)is defined in pmm.h
    //First we should init a physical memory manager(pmm) based on the framework.
    //Then pmm can alloc/free the physical memory. 
    //Now the first_fit/best_fit/worst_fit/buddy_system pmm are available.
    init_pmm_manager();
c01045fa:	e8 b2 f9 ff ff       	call   c0103fb1 <init_pmm_manager>

    // detect physical memory space, reserve already used memory,
    // then use pmm->init_memmap to create free page list
    page_init();
c01045ff:	e8 a1 fa ff ff       	call   c01040a5 <page_init>

    //use pmm->check to verify the correctness of the alloc/free function in a pmm
    check_alloc_page();
c0104604:	e8 5a 02 00 00       	call   c0104863 <check_alloc_page>

    check_pgdir();
c0104609:	e8 76 02 00 00       	call   c0104884 <check_pgdir>

    static_assert(KERNBASE % PTSIZE == 0 && KERNTOP % PTSIZE == 0);

    // recursively insert boot_pgdir in itself
    // to form a virtual page table at virtual address VPT
    boot_pgdir[PDX(VPT)] = PADDR(boot_pgdir) | PTE_P | PTE_W;
c010460e:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104613:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104616:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
c010461d:	77 23                	ja     c0104642 <pmm_init+0x8f>
c010461f:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104622:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104626:	c7 44 24 08 e8 6b 10 	movl   $0xc0106be8,0x8(%esp)
c010462d:	c0 
c010462e:	c7 44 24 04 2c 01 00 	movl   $0x12c,0x4(%esp)
c0104635:	00 
c0104636:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c010463d:	e8 ac c6 ff ff       	call   c0100cee <__panic>
c0104642:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104645:	8d 90 00 00 00 40    	lea    0x40000000(%eax),%edx
c010464b:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104650:	05 ac 0f 00 00       	add    $0xfac,%eax
c0104655:	83 ca 03             	or     $0x3,%edx
c0104658:	89 10                	mov    %edx,(%eax)

    // map all physical memory to linear memory with base linear addr KERNBASE
    // linear_addr KERNBASE ~ KERNBASE + KMEMSIZE = phy_addr 0 ~ KMEMSIZE
    boot_map_segment(boot_pgdir, KERNBASE, KMEMSIZE, 0, PTE_W);
c010465a:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c010465f:	c7 44 24 10 02 00 00 	movl   $0x2,0x10(%esp)
c0104666:	00 
c0104667:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c010466e:	00 
c010466f:	c7 44 24 08 00 00 00 	movl   $0x38000000,0x8(%esp)
c0104676:	38 
c0104677:	c7 44 24 04 00 00 00 	movl   $0xc0000000,0x4(%esp)
c010467e:	c0 
c010467f:	89 04 24             	mov    %eax,(%esp)
c0104682:	e8 e0 fd ff ff       	call   c0104467 <boot_map_segment>

    // Since we are using bootloader's GDT,
    // we should reload gdt (second time, the last time) to get user segments and the TSS
    // map virtual_addr 0 ~ 4G = linear_addr 0 ~ 4G
    // then set kernel stack (ss:esp) in TSS, setup TSS in gdt, load TSS
    gdt_init();
c0104687:	e8 39 f8 ff ff       	call   c0103ec5 <gdt_init>

    //now the basic virtual memory map(see memalyout.h) is established.
    //check the correctness of the basic virtual memory map.
    check_boot_pgdir();
c010468c:	e8 91 08 00 00       	call   c0104f22 <check_boot_pgdir>

    print_pgdir();
c0104691:	e8 0e 0d 00 00       	call   c01053a4 <print_pgdir>

}
c0104696:	90                   	nop
c0104697:	89 ec                	mov    %ebp,%esp
c0104699:	5d                   	pop    %ebp
c010469a:	c3                   	ret    

c010469b <get_pte>:
//  pgdir:  the kernel virtual base address of PDT
//  la:     the linear address need to map
//  create: a logical value to decide if alloc a page for PT
// return vaule: the kernel virtual address of this pte
pte_t *
get_pte(pde_t *pgdir, uintptr_t la, bool create) {
c010469b:	55                   	push   %ebp
c010469c:	89 e5                	mov    %esp,%ebp
                          // (6) clear page content using memset
                          // (7) set page directory entry's permission
    }
    return NULL;          // (8) return page table entry
#endif
}
c010469e:	90                   	nop
c010469f:	5d                   	pop    %ebp
c01046a0:	c3                   	ret    

c01046a1 <get_page>:

//get_page - get related Page struct for linear address la using PDT pgdir
struct Page *
get_page(pde_t *pgdir, uintptr_t la, pte_t **ptep_store) {
c01046a1:	55                   	push   %ebp
c01046a2:	89 e5                	mov    %esp,%ebp
c01046a4:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
c01046a7:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01046ae:	00 
c01046af:	8b 45 0c             	mov    0xc(%ebp),%eax
c01046b2:	89 44 24 04          	mov    %eax,0x4(%esp)
c01046b6:	8b 45 08             	mov    0x8(%ebp),%eax
c01046b9:	89 04 24             	mov    %eax,(%esp)
c01046bc:	e8 da ff ff ff       	call   c010469b <get_pte>
c01046c1:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep_store != NULL) {
c01046c4:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c01046c8:	74 08                	je     c01046d2 <get_page+0x31>
        *ptep_store = ptep;
c01046ca:	8b 45 10             	mov    0x10(%ebp),%eax
c01046cd:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01046d0:	89 10                	mov    %edx,(%eax)
    }
    if (ptep != NULL && *ptep & PTE_P) {
c01046d2:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01046d6:	74 1b                	je     c01046f3 <get_page+0x52>
c01046d8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01046db:	8b 00                	mov    (%eax),%eax
c01046dd:	83 e0 01             	and    $0x1,%eax
c01046e0:	85 c0                	test   %eax,%eax
c01046e2:	74 0f                	je     c01046f3 <get_page+0x52>
        return pte2page(*ptep);
c01046e4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01046e7:	8b 00                	mov    (%eax),%eax
c01046e9:	89 04 24             	mov    %eax,(%esp)
c01046ec:	e8 bc f6 ff ff       	call   c0103dad <pte2page>
c01046f1:	eb 05                	jmp    c01046f8 <get_page+0x57>
    }
    return NULL;
c01046f3:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01046f8:	89 ec                	mov    %ebp,%esp
c01046fa:	5d                   	pop    %ebp
c01046fb:	c3                   	ret    

c01046fc <page_remove_pte>:

//page_remove_pte - free an Page sturct which is related linear address la
//                - and clean(invalidate) pte which is related linear address la
//note: PT is changed, so the TLB need to be invalidate 
static inline void
page_remove_pte(pde_t *pgdir, uintptr_t la, pte_t *ptep) {
c01046fc:	55                   	push   %ebp
c01046fd:	89 e5                	mov    %esp,%ebp
                                  //(4) and free this page when page reference reachs 0
                                  //(5) clear second page table entry
                                  //(6) flush tlb
    }
#endif
}
c01046ff:	90                   	nop
c0104700:	5d                   	pop    %ebp
c0104701:	c3                   	ret    

c0104702 <page_remove>:

//page_remove - free an Page which is related linear address la and has an validated pte
void
page_remove(pde_t *pgdir, uintptr_t la) {
c0104702:	55                   	push   %ebp
c0104703:	89 e5                	mov    %esp,%ebp
c0104705:	83 ec 1c             	sub    $0x1c,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
c0104708:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c010470f:	00 
c0104710:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104713:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104717:	8b 45 08             	mov    0x8(%ebp),%eax
c010471a:	89 04 24             	mov    %eax,(%esp)
c010471d:	e8 79 ff ff ff       	call   c010469b <get_pte>
c0104722:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (ptep != NULL) {
c0104725:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
c0104729:	74 19                	je     c0104744 <page_remove+0x42>
        page_remove_pte(pgdir, la, ptep);
c010472b:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010472e:	89 44 24 08          	mov    %eax,0x8(%esp)
c0104732:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104735:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104739:	8b 45 08             	mov    0x8(%ebp),%eax
c010473c:	89 04 24             	mov    %eax,(%esp)
c010473f:	e8 b8 ff ff ff       	call   c01046fc <page_remove_pte>
    }
}
c0104744:	90                   	nop
c0104745:	89 ec                	mov    %ebp,%esp
c0104747:	5d                   	pop    %ebp
c0104748:	c3                   	ret    

c0104749 <page_insert>:
//  la:    the linear address need to map
//  perm:  the permission of this Page which is setted in related pte
// return value: always 0
//note: PT is changed, so the TLB need to be invalidate 
int
page_insert(pde_t *pgdir, struct Page *page, uintptr_t la, uint32_t perm) {
c0104749:	55                   	push   %ebp
c010474a:	89 e5                	mov    %esp,%ebp
c010474c:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 1);
c010474f:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
c0104756:	00 
c0104757:	8b 45 10             	mov    0x10(%ebp),%eax
c010475a:	89 44 24 04          	mov    %eax,0x4(%esp)
c010475e:	8b 45 08             	mov    0x8(%ebp),%eax
c0104761:	89 04 24             	mov    %eax,(%esp)
c0104764:	e8 32 ff ff ff       	call   c010469b <get_pte>
c0104769:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep == NULL) {
c010476c:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104770:	75 0a                	jne    c010477c <page_insert+0x33>
        return -E_NO_MEM;
c0104772:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
c0104777:	e9 84 00 00 00       	jmp    c0104800 <page_insert+0xb7>
    }
    page_ref_inc(page);
c010477c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010477f:	89 04 24             	mov    %eax,(%esp)
c0104782:	e8 8a f6 ff ff       	call   c0103e11 <page_ref_inc>
    if (*ptep & PTE_P) {
c0104787:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010478a:	8b 00                	mov    (%eax),%eax
c010478c:	83 e0 01             	and    $0x1,%eax
c010478f:	85 c0                	test   %eax,%eax
c0104791:	74 3e                	je     c01047d1 <page_insert+0x88>
        struct Page *p = pte2page(*ptep);
c0104793:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104796:	8b 00                	mov    (%eax),%eax
c0104798:	89 04 24             	mov    %eax,(%esp)
c010479b:	e8 0d f6 ff ff       	call   c0103dad <pte2page>
c01047a0:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (p == page) {
c01047a3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01047a6:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01047a9:	75 0d                	jne    c01047b8 <page_insert+0x6f>
            page_ref_dec(page);
c01047ab:	8b 45 0c             	mov    0xc(%ebp),%eax
c01047ae:	89 04 24             	mov    %eax,(%esp)
c01047b1:	e8 72 f6 ff ff       	call   c0103e28 <page_ref_dec>
c01047b6:	eb 19                	jmp    c01047d1 <page_insert+0x88>
        }
        else {
            page_remove_pte(pgdir, la, ptep);
c01047b8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01047bb:	89 44 24 08          	mov    %eax,0x8(%esp)
c01047bf:	8b 45 10             	mov    0x10(%ebp),%eax
c01047c2:	89 44 24 04          	mov    %eax,0x4(%esp)
c01047c6:	8b 45 08             	mov    0x8(%ebp),%eax
c01047c9:	89 04 24             	mov    %eax,(%esp)
c01047cc:	e8 2b ff ff ff       	call   c01046fc <page_remove_pte>
        }
    }
    *ptep = page2pa(page) | PTE_P | perm;
c01047d1:	8b 45 0c             	mov    0xc(%ebp),%eax
c01047d4:	89 04 24             	mov    %eax,(%esp)
c01047d7:	e8 12 f5 ff ff       	call   c0103cee <page2pa>
c01047dc:	0b 45 14             	or     0x14(%ebp),%eax
c01047df:	83 c8 01             	or     $0x1,%eax
c01047e2:	89 c2                	mov    %eax,%edx
c01047e4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01047e7:	89 10                	mov    %edx,(%eax)
    tlb_invalidate(pgdir, la);
c01047e9:	8b 45 10             	mov    0x10(%ebp),%eax
c01047ec:	89 44 24 04          	mov    %eax,0x4(%esp)
c01047f0:	8b 45 08             	mov    0x8(%ebp),%eax
c01047f3:	89 04 24             	mov    %eax,(%esp)
c01047f6:	e8 09 00 00 00       	call   c0104804 <tlb_invalidate>
    return 0;
c01047fb:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0104800:	89 ec                	mov    %ebp,%esp
c0104802:	5d                   	pop    %ebp
c0104803:	c3                   	ret    

c0104804 <tlb_invalidate>:

// invalidate a TLB entry, but only if the page tables being
// edited are the ones currently in use by the processor.
void
tlb_invalidate(pde_t *pgdir, uintptr_t la) {
c0104804:	55                   	push   %ebp
c0104805:	89 e5                	mov    %esp,%ebp
c0104807:	83 ec 28             	sub    $0x28,%esp
}

static inline uintptr_t
rcr3(void) {
    uintptr_t cr3;
    asm volatile ("mov %%cr3, %0" : "=r" (cr3) :: "memory");
c010480a:	0f 20 d8             	mov    %cr3,%eax
c010480d:	89 45 f0             	mov    %eax,-0x10(%ebp)
    return cr3;
c0104810:	8b 55 f0             	mov    -0x10(%ebp),%edx
    if (rcr3() == PADDR(pgdir)) {
c0104813:	8b 45 08             	mov    0x8(%ebp),%eax
c0104816:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0104819:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c0104820:	77 23                	ja     c0104845 <tlb_invalidate+0x41>
c0104822:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104825:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104829:	c7 44 24 08 e8 6b 10 	movl   $0xc0106be8,0x8(%esp)
c0104830:	c0 
c0104831:	c7 44 24 04 c3 01 00 	movl   $0x1c3,0x4(%esp)
c0104838:	00 
c0104839:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104840:	e8 a9 c4 ff ff       	call   c0100cee <__panic>
c0104845:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104848:	05 00 00 00 40       	add    $0x40000000,%eax
c010484d:	39 d0                	cmp    %edx,%eax
c010484f:	75 0d                	jne    c010485e <tlb_invalidate+0x5a>
        invlpg((void *)la);
c0104851:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104854:	89 45 ec             	mov    %eax,-0x14(%ebp)
}

static inline void
invlpg(void *addr) {
    asm volatile ("invlpg (%0)" :: "r" (addr) : "memory");
c0104857:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010485a:	0f 01 38             	invlpg (%eax)
}
c010485d:	90                   	nop
    }
}
c010485e:	90                   	nop
c010485f:	89 ec                	mov    %ebp,%esp
c0104861:	5d                   	pop    %ebp
c0104862:	c3                   	ret    

c0104863 <check_alloc_page>:

static void
check_alloc_page(void) {
c0104863:	55                   	push   %ebp
c0104864:	89 e5                	mov    %esp,%ebp
c0104866:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->check();
c0104869:	a1 cc ce 11 c0       	mov    0xc011cecc,%eax
c010486e:	8b 40 18             	mov    0x18(%eax),%eax
c0104871:	ff d0                	call   *%eax
    cprintf("check_alloc_page() succeeded!\n");
c0104873:	c7 04 24 6c 6c 10 c0 	movl   $0xc0106c6c,(%esp)
c010487a:	e8 e7 ba ff ff       	call   c0100366 <cprintf>
}
c010487f:	90                   	nop
c0104880:	89 ec                	mov    %ebp,%esp
c0104882:	5d                   	pop    %ebp
c0104883:	c3                   	ret    

c0104884 <check_pgdir>:

static void
check_pgdir(void) {
c0104884:	55                   	push   %ebp
c0104885:	89 e5                	mov    %esp,%ebp
c0104887:	83 ec 38             	sub    $0x38,%esp
    assert(npage <= KMEMSIZE / PGSIZE);
c010488a:	a1 c4 ce 11 c0       	mov    0xc011cec4,%eax
c010488f:	3d 00 80 03 00       	cmp    $0x38000,%eax
c0104894:	76 24                	jbe    c01048ba <check_pgdir+0x36>
c0104896:	c7 44 24 0c 8b 6c 10 	movl   $0xc0106c8b,0xc(%esp)
c010489d:	c0 
c010489e:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c01048a5:	c0 
c01048a6:	c7 44 24 04 d0 01 00 	movl   $0x1d0,0x4(%esp)
c01048ad:	00 
c01048ae:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c01048b5:	e8 34 c4 ff ff       	call   c0100cee <__panic>
    assert(boot_pgdir != NULL && (uint32_t)PGOFF(boot_pgdir) == 0);
c01048ba:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c01048bf:	85 c0                	test   %eax,%eax
c01048c1:	74 0e                	je     c01048d1 <check_pgdir+0x4d>
c01048c3:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c01048c8:	25 ff 0f 00 00       	and    $0xfff,%eax
c01048cd:	85 c0                	test   %eax,%eax
c01048cf:	74 24                	je     c01048f5 <check_pgdir+0x71>
c01048d1:	c7 44 24 0c a8 6c 10 	movl   $0xc0106ca8,0xc(%esp)
c01048d8:	c0 
c01048d9:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c01048e0:	c0 
c01048e1:	c7 44 24 04 d1 01 00 	movl   $0x1d1,0x4(%esp)
c01048e8:	00 
c01048e9:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c01048f0:	e8 f9 c3 ff ff       	call   c0100cee <__panic>
    assert(get_page(boot_pgdir, 0x0, NULL) == NULL);
c01048f5:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c01048fa:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104901:	00 
c0104902:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0104909:	00 
c010490a:	89 04 24             	mov    %eax,(%esp)
c010490d:	e8 8f fd ff ff       	call   c01046a1 <get_page>
c0104912:	85 c0                	test   %eax,%eax
c0104914:	74 24                	je     c010493a <check_pgdir+0xb6>
c0104916:	c7 44 24 0c e0 6c 10 	movl   $0xc0106ce0,0xc(%esp)
c010491d:	c0 
c010491e:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104925:	c0 
c0104926:	c7 44 24 04 d2 01 00 	movl   $0x1d2,0x4(%esp)
c010492d:	00 
c010492e:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104935:	e8 b4 c3 ff ff       	call   c0100cee <__panic>

    struct Page *p1, *p2;
    p1 = alloc_page();
c010493a:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0104941:	e8 c3 f6 ff ff       	call   c0104009 <alloc_pages>
c0104946:	89 45 f4             	mov    %eax,-0xc(%ebp)
    assert(page_insert(boot_pgdir, p1, 0x0, 0) == 0);
c0104949:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c010494e:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c0104955:	00 
c0104956:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c010495d:	00 
c010495e:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0104961:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104965:	89 04 24             	mov    %eax,(%esp)
c0104968:	e8 dc fd ff ff       	call   c0104749 <page_insert>
c010496d:	85 c0                	test   %eax,%eax
c010496f:	74 24                	je     c0104995 <check_pgdir+0x111>
c0104971:	c7 44 24 0c 08 6d 10 	movl   $0xc0106d08,0xc(%esp)
c0104978:	c0 
c0104979:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104980:	c0 
c0104981:	c7 44 24 04 d6 01 00 	movl   $0x1d6,0x4(%esp)
c0104988:	00 
c0104989:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104990:	e8 59 c3 ff ff       	call   c0100cee <__panic>

    pte_t *ptep;
    assert((ptep = get_pte(boot_pgdir, 0x0, 0)) != NULL);
c0104995:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c010499a:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01049a1:	00 
c01049a2:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c01049a9:	00 
c01049aa:	89 04 24             	mov    %eax,(%esp)
c01049ad:	e8 e9 fc ff ff       	call   c010469b <get_pte>
c01049b2:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01049b5:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01049b9:	75 24                	jne    c01049df <check_pgdir+0x15b>
c01049bb:	c7 44 24 0c 34 6d 10 	movl   $0xc0106d34,0xc(%esp)
c01049c2:	c0 
c01049c3:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c01049ca:	c0 
c01049cb:	c7 44 24 04 d9 01 00 	movl   $0x1d9,0x4(%esp)
c01049d2:	00 
c01049d3:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c01049da:	e8 0f c3 ff ff       	call   c0100cee <__panic>
    assert(pte2page(*ptep) == p1);
c01049df:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01049e2:	8b 00                	mov    (%eax),%eax
c01049e4:	89 04 24             	mov    %eax,(%esp)
c01049e7:	e8 c1 f3 ff ff       	call   c0103dad <pte2page>
c01049ec:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c01049ef:	74 24                	je     c0104a15 <check_pgdir+0x191>
c01049f1:	c7 44 24 0c 61 6d 10 	movl   $0xc0106d61,0xc(%esp)
c01049f8:	c0 
c01049f9:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104a00:	c0 
c0104a01:	c7 44 24 04 da 01 00 	movl   $0x1da,0x4(%esp)
c0104a08:	00 
c0104a09:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104a10:	e8 d9 c2 ff ff       	call   c0100cee <__panic>
    assert(page_ref(p1) == 1);
c0104a15:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104a18:	89 04 24             	mov    %eax,(%esp)
c0104a1b:	e8 e7 f3 ff ff       	call   c0103e07 <page_ref>
c0104a20:	83 f8 01             	cmp    $0x1,%eax
c0104a23:	74 24                	je     c0104a49 <check_pgdir+0x1c5>
c0104a25:	c7 44 24 0c 77 6d 10 	movl   $0xc0106d77,0xc(%esp)
c0104a2c:	c0 
c0104a2d:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104a34:	c0 
c0104a35:	c7 44 24 04 db 01 00 	movl   $0x1db,0x4(%esp)
c0104a3c:	00 
c0104a3d:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104a44:	e8 a5 c2 ff ff       	call   c0100cee <__panic>

    ptep = &((pte_t *)KADDR(PDE_ADDR(boot_pgdir[0])))[1];
c0104a49:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104a4e:	8b 00                	mov    (%eax),%eax
c0104a50:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104a55:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0104a58:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104a5b:	c1 e8 0c             	shr    $0xc,%eax
c0104a5e:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0104a61:	a1 c4 ce 11 c0       	mov    0xc011cec4,%eax
c0104a66:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0104a69:	72 23                	jb     c0104a8e <check_pgdir+0x20a>
c0104a6b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104a6e:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104a72:	c7 44 24 08 44 6b 10 	movl   $0xc0106b44,0x8(%esp)
c0104a79:	c0 
c0104a7a:	c7 44 24 04 dd 01 00 	movl   $0x1dd,0x4(%esp)
c0104a81:	00 
c0104a82:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104a89:	e8 60 c2 ff ff       	call   c0100cee <__panic>
c0104a8e:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104a91:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0104a96:	83 c0 04             	add    $0x4,%eax
c0104a99:	89 45 f0             	mov    %eax,-0x10(%ebp)
    assert(get_pte(boot_pgdir, PGSIZE, 0) == ptep);
c0104a9c:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104aa1:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104aa8:	00 
c0104aa9:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104ab0:	00 
c0104ab1:	89 04 24             	mov    %eax,(%esp)
c0104ab4:	e8 e2 fb ff ff       	call   c010469b <get_pte>
c0104ab9:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0104abc:	74 24                	je     c0104ae2 <check_pgdir+0x25e>
c0104abe:	c7 44 24 0c 8c 6d 10 	movl   $0xc0106d8c,0xc(%esp)
c0104ac5:	c0 
c0104ac6:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104acd:	c0 
c0104ace:	c7 44 24 04 de 01 00 	movl   $0x1de,0x4(%esp)
c0104ad5:	00 
c0104ad6:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104add:	e8 0c c2 ff ff       	call   c0100cee <__panic>

    p2 = alloc_page();
c0104ae2:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0104ae9:	e8 1b f5 ff ff       	call   c0104009 <alloc_pages>
c0104aee:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(page_insert(boot_pgdir, p2, PGSIZE, PTE_U | PTE_W) == 0);
c0104af1:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104af6:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
c0104afd:	00 
c0104afe:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104b05:	00 
c0104b06:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0104b09:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104b0d:	89 04 24             	mov    %eax,(%esp)
c0104b10:	e8 34 fc ff ff       	call   c0104749 <page_insert>
c0104b15:	85 c0                	test   %eax,%eax
c0104b17:	74 24                	je     c0104b3d <check_pgdir+0x2b9>
c0104b19:	c7 44 24 0c b4 6d 10 	movl   $0xc0106db4,0xc(%esp)
c0104b20:	c0 
c0104b21:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104b28:	c0 
c0104b29:	c7 44 24 04 e1 01 00 	movl   $0x1e1,0x4(%esp)
c0104b30:	00 
c0104b31:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104b38:	e8 b1 c1 ff ff       	call   c0100cee <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0104b3d:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104b42:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104b49:	00 
c0104b4a:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104b51:	00 
c0104b52:	89 04 24             	mov    %eax,(%esp)
c0104b55:	e8 41 fb ff ff       	call   c010469b <get_pte>
c0104b5a:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104b5d:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0104b61:	75 24                	jne    c0104b87 <check_pgdir+0x303>
c0104b63:	c7 44 24 0c ec 6d 10 	movl   $0xc0106dec,0xc(%esp)
c0104b6a:	c0 
c0104b6b:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104b72:	c0 
c0104b73:	c7 44 24 04 e2 01 00 	movl   $0x1e2,0x4(%esp)
c0104b7a:	00 
c0104b7b:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104b82:	e8 67 c1 ff ff       	call   c0100cee <__panic>
    assert(*ptep & PTE_U);
c0104b87:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104b8a:	8b 00                	mov    (%eax),%eax
c0104b8c:	83 e0 04             	and    $0x4,%eax
c0104b8f:	85 c0                	test   %eax,%eax
c0104b91:	75 24                	jne    c0104bb7 <check_pgdir+0x333>
c0104b93:	c7 44 24 0c 1c 6e 10 	movl   $0xc0106e1c,0xc(%esp)
c0104b9a:	c0 
c0104b9b:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104ba2:	c0 
c0104ba3:	c7 44 24 04 e3 01 00 	movl   $0x1e3,0x4(%esp)
c0104baa:	00 
c0104bab:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104bb2:	e8 37 c1 ff ff       	call   c0100cee <__panic>
    assert(*ptep & PTE_W);
c0104bb7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104bba:	8b 00                	mov    (%eax),%eax
c0104bbc:	83 e0 02             	and    $0x2,%eax
c0104bbf:	85 c0                	test   %eax,%eax
c0104bc1:	75 24                	jne    c0104be7 <check_pgdir+0x363>
c0104bc3:	c7 44 24 0c 2a 6e 10 	movl   $0xc0106e2a,0xc(%esp)
c0104bca:	c0 
c0104bcb:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104bd2:	c0 
c0104bd3:	c7 44 24 04 e4 01 00 	movl   $0x1e4,0x4(%esp)
c0104bda:	00 
c0104bdb:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104be2:	e8 07 c1 ff ff       	call   c0100cee <__panic>
    assert(boot_pgdir[0] & PTE_U);
c0104be7:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104bec:	8b 00                	mov    (%eax),%eax
c0104bee:	83 e0 04             	and    $0x4,%eax
c0104bf1:	85 c0                	test   %eax,%eax
c0104bf3:	75 24                	jne    c0104c19 <check_pgdir+0x395>
c0104bf5:	c7 44 24 0c 38 6e 10 	movl   $0xc0106e38,0xc(%esp)
c0104bfc:	c0 
c0104bfd:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104c04:	c0 
c0104c05:	c7 44 24 04 e5 01 00 	movl   $0x1e5,0x4(%esp)
c0104c0c:	00 
c0104c0d:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104c14:	e8 d5 c0 ff ff       	call   c0100cee <__panic>
    assert(page_ref(p2) == 1);
c0104c19:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104c1c:	89 04 24             	mov    %eax,(%esp)
c0104c1f:	e8 e3 f1 ff ff       	call   c0103e07 <page_ref>
c0104c24:	83 f8 01             	cmp    $0x1,%eax
c0104c27:	74 24                	je     c0104c4d <check_pgdir+0x3c9>
c0104c29:	c7 44 24 0c 4e 6e 10 	movl   $0xc0106e4e,0xc(%esp)
c0104c30:	c0 
c0104c31:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104c38:	c0 
c0104c39:	c7 44 24 04 e6 01 00 	movl   $0x1e6,0x4(%esp)
c0104c40:	00 
c0104c41:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104c48:	e8 a1 c0 ff ff       	call   c0100cee <__panic>

    assert(page_insert(boot_pgdir, p1, PGSIZE, 0) == 0);
c0104c4d:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104c52:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c0104c59:	00 
c0104c5a:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104c61:	00 
c0104c62:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0104c65:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104c69:	89 04 24             	mov    %eax,(%esp)
c0104c6c:	e8 d8 fa ff ff       	call   c0104749 <page_insert>
c0104c71:	85 c0                	test   %eax,%eax
c0104c73:	74 24                	je     c0104c99 <check_pgdir+0x415>
c0104c75:	c7 44 24 0c 60 6e 10 	movl   $0xc0106e60,0xc(%esp)
c0104c7c:	c0 
c0104c7d:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104c84:	c0 
c0104c85:	c7 44 24 04 e8 01 00 	movl   $0x1e8,0x4(%esp)
c0104c8c:	00 
c0104c8d:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104c94:	e8 55 c0 ff ff       	call   c0100cee <__panic>
    assert(page_ref(p1) == 2);
c0104c99:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104c9c:	89 04 24             	mov    %eax,(%esp)
c0104c9f:	e8 63 f1 ff ff       	call   c0103e07 <page_ref>
c0104ca4:	83 f8 02             	cmp    $0x2,%eax
c0104ca7:	74 24                	je     c0104ccd <check_pgdir+0x449>
c0104ca9:	c7 44 24 0c 8c 6e 10 	movl   $0xc0106e8c,0xc(%esp)
c0104cb0:	c0 
c0104cb1:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104cb8:	c0 
c0104cb9:	c7 44 24 04 e9 01 00 	movl   $0x1e9,0x4(%esp)
c0104cc0:	00 
c0104cc1:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104cc8:	e8 21 c0 ff ff       	call   c0100cee <__panic>
    assert(page_ref(p2) == 0);
c0104ccd:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104cd0:	89 04 24             	mov    %eax,(%esp)
c0104cd3:	e8 2f f1 ff ff       	call   c0103e07 <page_ref>
c0104cd8:	85 c0                	test   %eax,%eax
c0104cda:	74 24                	je     c0104d00 <check_pgdir+0x47c>
c0104cdc:	c7 44 24 0c 9e 6e 10 	movl   $0xc0106e9e,0xc(%esp)
c0104ce3:	c0 
c0104ce4:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104ceb:	c0 
c0104cec:	c7 44 24 04 ea 01 00 	movl   $0x1ea,0x4(%esp)
c0104cf3:	00 
c0104cf4:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104cfb:	e8 ee bf ff ff       	call   c0100cee <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0104d00:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104d05:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104d0c:	00 
c0104d0d:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104d14:	00 
c0104d15:	89 04 24             	mov    %eax,(%esp)
c0104d18:	e8 7e f9 ff ff       	call   c010469b <get_pte>
c0104d1d:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104d20:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0104d24:	75 24                	jne    c0104d4a <check_pgdir+0x4c6>
c0104d26:	c7 44 24 0c ec 6d 10 	movl   $0xc0106dec,0xc(%esp)
c0104d2d:	c0 
c0104d2e:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104d35:	c0 
c0104d36:	c7 44 24 04 eb 01 00 	movl   $0x1eb,0x4(%esp)
c0104d3d:	00 
c0104d3e:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104d45:	e8 a4 bf ff ff       	call   c0100cee <__panic>
    assert(pte2page(*ptep) == p1);
c0104d4a:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104d4d:	8b 00                	mov    (%eax),%eax
c0104d4f:	89 04 24             	mov    %eax,(%esp)
c0104d52:	e8 56 f0 ff ff       	call   c0103dad <pte2page>
c0104d57:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0104d5a:	74 24                	je     c0104d80 <check_pgdir+0x4fc>
c0104d5c:	c7 44 24 0c 61 6d 10 	movl   $0xc0106d61,0xc(%esp)
c0104d63:	c0 
c0104d64:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104d6b:	c0 
c0104d6c:	c7 44 24 04 ec 01 00 	movl   $0x1ec,0x4(%esp)
c0104d73:	00 
c0104d74:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104d7b:	e8 6e bf ff ff       	call   c0100cee <__panic>
    assert((*ptep & PTE_U) == 0);
c0104d80:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104d83:	8b 00                	mov    (%eax),%eax
c0104d85:	83 e0 04             	and    $0x4,%eax
c0104d88:	85 c0                	test   %eax,%eax
c0104d8a:	74 24                	je     c0104db0 <check_pgdir+0x52c>
c0104d8c:	c7 44 24 0c b0 6e 10 	movl   $0xc0106eb0,0xc(%esp)
c0104d93:	c0 
c0104d94:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104d9b:	c0 
c0104d9c:	c7 44 24 04 ed 01 00 	movl   $0x1ed,0x4(%esp)
c0104da3:	00 
c0104da4:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104dab:	e8 3e bf ff ff       	call   c0100cee <__panic>

    page_remove(boot_pgdir, 0x0);
c0104db0:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104db5:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0104dbc:	00 
c0104dbd:	89 04 24             	mov    %eax,(%esp)
c0104dc0:	e8 3d f9 ff ff       	call   c0104702 <page_remove>
    assert(page_ref(p1) == 1);
c0104dc5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104dc8:	89 04 24             	mov    %eax,(%esp)
c0104dcb:	e8 37 f0 ff ff       	call   c0103e07 <page_ref>
c0104dd0:	83 f8 01             	cmp    $0x1,%eax
c0104dd3:	74 24                	je     c0104df9 <check_pgdir+0x575>
c0104dd5:	c7 44 24 0c 77 6d 10 	movl   $0xc0106d77,0xc(%esp)
c0104ddc:	c0 
c0104ddd:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104de4:	c0 
c0104de5:	c7 44 24 04 f0 01 00 	movl   $0x1f0,0x4(%esp)
c0104dec:	00 
c0104ded:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104df4:	e8 f5 be ff ff       	call   c0100cee <__panic>
    assert(page_ref(p2) == 0);
c0104df9:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104dfc:	89 04 24             	mov    %eax,(%esp)
c0104dff:	e8 03 f0 ff ff       	call   c0103e07 <page_ref>
c0104e04:	85 c0                	test   %eax,%eax
c0104e06:	74 24                	je     c0104e2c <check_pgdir+0x5a8>
c0104e08:	c7 44 24 0c 9e 6e 10 	movl   $0xc0106e9e,0xc(%esp)
c0104e0f:	c0 
c0104e10:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104e17:	c0 
c0104e18:	c7 44 24 04 f1 01 00 	movl   $0x1f1,0x4(%esp)
c0104e1f:	00 
c0104e20:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104e27:	e8 c2 be ff ff       	call   c0100cee <__panic>

    page_remove(boot_pgdir, PGSIZE);
c0104e2c:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104e31:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104e38:	00 
c0104e39:	89 04 24             	mov    %eax,(%esp)
c0104e3c:	e8 c1 f8 ff ff       	call   c0104702 <page_remove>
    assert(page_ref(p1) == 0);
c0104e41:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104e44:	89 04 24             	mov    %eax,(%esp)
c0104e47:	e8 bb ef ff ff       	call   c0103e07 <page_ref>
c0104e4c:	85 c0                	test   %eax,%eax
c0104e4e:	74 24                	je     c0104e74 <check_pgdir+0x5f0>
c0104e50:	c7 44 24 0c c5 6e 10 	movl   $0xc0106ec5,0xc(%esp)
c0104e57:	c0 
c0104e58:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104e5f:	c0 
c0104e60:	c7 44 24 04 f4 01 00 	movl   $0x1f4,0x4(%esp)
c0104e67:	00 
c0104e68:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104e6f:	e8 7a be ff ff       	call   c0100cee <__panic>
    assert(page_ref(p2) == 0);
c0104e74:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104e77:	89 04 24             	mov    %eax,(%esp)
c0104e7a:	e8 88 ef ff ff       	call   c0103e07 <page_ref>
c0104e7f:	85 c0                	test   %eax,%eax
c0104e81:	74 24                	je     c0104ea7 <check_pgdir+0x623>
c0104e83:	c7 44 24 0c 9e 6e 10 	movl   $0xc0106e9e,0xc(%esp)
c0104e8a:	c0 
c0104e8b:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104e92:	c0 
c0104e93:	c7 44 24 04 f5 01 00 	movl   $0x1f5,0x4(%esp)
c0104e9a:	00 
c0104e9b:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104ea2:	e8 47 be ff ff       	call   c0100cee <__panic>

    assert(page_ref(pde2page(boot_pgdir[0])) == 1);
c0104ea7:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104eac:	8b 00                	mov    (%eax),%eax
c0104eae:	89 04 24             	mov    %eax,(%esp)
c0104eb1:	e8 37 ef ff ff       	call   c0103ded <pde2page>
c0104eb6:	89 04 24             	mov    %eax,(%esp)
c0104eb9:	e8 49 ef ff ff       	call   c0103e07 <page_ref>
c0104ebe:	83 f8 01             	cmp    $0x1,%eax
c0104ec1:	74 24                	je     c0104ee7 <check_pgdir+0x663>
c0104ec3:	c7 44 24 0c d8 6e 10 	movl   $0xc0106ed8,0xc(%esp)
c0104eca:	c0 
c0104ecb:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104ed2:	c0 
c0104ed3:	c7 44 24 04 f7 01 00 	movl   $0x1f7,0x4(%esp)
c0104eda:	00 
c0104edb:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104ee2:	e8 07 be ff ff       	call   c0100cee <__panic>
    free_page(pde2page(boot_pgdir[0]));
c0104ee7:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104eec:	8b 00                	mov    (%eax),%eax
c0104eee:	89 04 24             	mov    %eax,(%esp)
c0104ef1:	e8 f7 ee ff ff       	call   c0103ded <pde2page>
c0104ef6:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0104efd:	00 
c0104efe:	89 04 24             	mov    %eax,(%esp)
c0104f01:	e8 3d f1 ff ff       	call   c0104043 <free_pages>
    boot_pgdir[0] = 0;
c0104f06:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104f0b:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_pgdir() succeeded!\n");
c0104f11:	c7 04 24 ff 6e 10 c0 	movl   $0xc0106eff,(%esp)
c0104f18:	e8 49 b4 ff ff       	call   c0100366 <cprintf>
}
c0104f1d:	90                   	nop
c0104f1e:	89 ec                	mov    %ebp,%esp
c0104f20:	5d                   	pop    %ebp
c0104f21:	c3                   	ret    

c0104f22 <check_boot_pgdir>:

static void
check_boot_pgdir(void) {
c0104f22:	55                   	push   %ebp
c0104f23:	89 e5                	mov    %esp,%ebp
c0104f25:	83 ec 38             	sub    $0x38,%esp
    pte_t *ptep;
    int i;
    for (i = 0; i < npage; i += PGSIZE) {
c0104f28:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0104f2f:	e9 ca 00 00 00       	jmp    c0104ffe <check_boot_pgdir+0xdc>
        assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
c0104f34:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104f37:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0104f3a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104f3d:	c1 e8 0c             	shr    $0xc,%eax
c0104f40:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0104f43:	a1 c4 ce 11 c0       	mov    0xc011cec4,%eax
c0104f48:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c0104f4b:	72 23                	jb     c0104f70 <check_boot_pgdir+0x4e>
c0104f4d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104f50:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104f54:	c7 44 24 08 44 6b 10 	movl   $0xc0106b44,0x8(%esp)
c0104f5b:	c0 
c0104f5c:	c7 44 24 04 03 02 00 	movl   $0x203,0x4(%esp)
c0104f63:	00 
c0104f64:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104f6b:	e8 7e bd ff ff       	call   c0100cee <__panic>
c0104f70:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104f73:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0104f78:	89 c2                	mov    %eax,%edx
c0104f7a:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104f7f:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104f86:	00 
c0104f87:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104f8b:	89 04 24             	mov    %eax,(%esp)
c0104f8e:	e8 08 f7 ff ff       	call   c010469b <get_pte>
c0104f93:	89 45 dc             	mov    %eax,-0x24(%ebp)
c0104f96:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0104f9a:	75 24                	jne    c0104fc0 <check_boot_pgdir+0x9e>
c0104f9c:	c7 44 24 0c 1c 6f 10 	movl   $0xc0106f1c,0xc(%esp)
c0104fa3:	c0 
c0104fa4:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104fab:	c0 
c0104fac:	c7 44 24 04 03 02 00 	movl   $0x203,0x4(%esp)
c0104fb3:	00 
c0104fb4:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104fbb:	e8 2e bd ff ff       	call   c0100cee <__panic>
        assert(PTE_ADDR(*ptep) == i);
c0104fc0:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0104fc3:	8b 00                	mov    (%eax),%eax
c0104fc5:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104fca:	89 c2                	mov    %eax,%edx
c0104fcc:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104fcf:	39 c2                	cmp    %eax,%edx
c0104fd1:	74 24                	je     c0104ff7 <check_boot_pgdir+0xd5>
c0104fd3:	c7 44 24 0c 59 6f 10 	movl   $0xc0106f59,0xc(%esp)
c0104fda:	c0 
c0104fdb:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0104fe2:	c0 
c0104fe3:	c7 44 24 04 04 02 00 	movl   $0x204,0x4(%esp)
c0104fea:	00 
c0104feb:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0104ff2:	e8 f7 bc ff ff       	call   c0100cee <__panic>
    for (i = 0; i < npage; i += PGSIZE) {
c0104ff7:	81 45 f4 00 10 00 00 	addl   $0x1000,-0xc(%ebp)
c0104ffe:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0105001:	a1 c4 ce 11 c0       	mov    0xc011cec4,%eax
c0105006:	39 c2                	cmp    %eax,%edx
c0105008:	0f 82 26 ff ff ff    	jb     c0104f34 <check_boot_pgdir+0x12>
    }

    assert(PDE_ADDR(boot_pgdir[PDX(VPT)]) == PADDR(boot_pgdir));
c010500e:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0105013:	05 ac 0f 00 00       	add    $0xfac,%eax
c0105018:	8b 00                	mov    (%eax),%eax
c010501a:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c010501f:	89 c2                	mov    %eax,%edx
c0105021:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0105026:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105029:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
c0105030:	77 23                	ja     c0105055 <check_boot_pgdir+0x133>
c0105032:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105035:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105039:	c7 44 24 08 e8 6b 10 	movl   $0xc0106be8,0x8(%esp)
c0105040:	c0 
c0105041:	c7 44 24 04 07 02 00 	movl   $0x207,0x4(%esp)
c0105048:	00 
c0105049:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0105050:	e8 99 bc ff ff       	call   c0100cee <__panic>
c0105055:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105058:	05 00 00 00 40       	add    $0x40000000,%eax
c010505d:	39 d0                	cmp    %edx,%eax
c010505f:	74 24                	je     c0105085 <check_boot_pgdir+0x163>
c0105061:	c7 44 24 0c 70 6f 10 	movl   $0xc0106f70,0xc(%esp)
c0105068:	c0 
c0105069:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0105070:	c0 
c0105071:	c7 44 24 04 07 02 00 	movl   $0x207,0x4(%esp)
c0105078:	00 
c0105079:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0105080:	e8 69 bc ff ff       	call   c0100cee <__panic>

    assert(boot_pgdir[0] == 0);
c0105085:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c010508a:	8b 00                	mov    (%eax),%eax
c010508c:	85 c0                	test   %eax,%eax
c010508e:	74 24                	je     c01050b4 <check_boot_pgdir+0x192>
c0105090:	c7 44 24 0c a4 6f 10 	movl   $0xc0106fa4,0xc(%esp)
c0105097:	c0 
c0105098:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c010509f:	c0 
c01050a0:	c7 44 24 04 09 02 00 	movl   $0x209,0x4(%esp)
c01050a7:	00 
c01050a8:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c01050af:	e8 3a bc ff ff       	call   c0100cee <__panic>

    struct Page *p;
    p = alloc_page();
c01050b4:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01050bb:	e8 49 ef ff ff       	call   c0104009 <alloc_pages>
c01050c0:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert(page_insert(boot_pgdir, p, 0x100, PTE_W) == 0);
c01050c3:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c01050c8:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
c01050cf:	00 
c01050d0:	c7 44 24 08 00 01 00 	movl   $0x100,0x8(%esp)
c01050d7:	00 
c01050d8:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01050db:	89 54 24 04          	mov    %edx,0x4(%esp)
c01050df:	89 04 24             	mov    %eax,(%esp)
c01050e2:	e8 62 f6 ff ff       	call   c0104749 <page_insert>
c01050e7:	85 c0                	test   %eax,%eax
c01050e9:	74 24                	je     c010510f <check_boot_pgdir+0x1ed>
c01050eb:	c7 44 24 0c b8 6f 10 	movl   $0xc0106fb8,0xc(%esp)
c01050f2:	c0 
c01050f3:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c01050fa:	c0 
c01050fb:	c7 44 24 04 0d 02 00 	movl   $0x20d,0x4(%esp)
c0105102:	00 
c0105103:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c010510a:	e8 df bb ff ff       	call   c0100cee <__panic>
    assert(page_ref(p) == 1);
c010510f:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105112:	89 04 24             	mov    %eax,(%esp)
c0105115:	e8 ed ec ff ff       	call   c0103e07 <page_ref>
c010511a:	83 f8 01             	cmp    $0x1,%eax
c010511d:	74 24                	je     c0105143 <check_boot_pgdir+0x221>
c010511f:	c7 44 24 0c e6 6f 10 	movl   $0xc0106fe6,0xc(%esp)
c0105126:	c0 
c0105127:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c010512e:	c0 
c010512f:	c7 44 24 04 0e 02 00 	movl   $0x20e,0x4(%esp)
c0105136:	00 
c0105137:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c010513e:	e8 ab bb ff ff       	call   c0100cee <__panic>
    assert(page_insert(boot_pgdir, p, 0x100 + PGSIZE, PTE_W) == 0);
c0105143:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0105148:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
c010514f:	00 
c0105150:	c7 44 24 08 00 11 00 	movl   $0x1100,0x8(%esp)
c0105157:	00 
c0105158:	8b 55 ec             	mov    -0x14(%ebp),%edx
c010515b:	89 54 24 04          	mov    %edx,0x4(%esp)
c010515f:	89 04 24             	mov    %eax,(%esp)
c0105162:	e8 e2 f5 ff ff       	call   c0104749 <page_insert>
c0105167:	85 c0                	test   %eax,%eax
c0105169:	74 24                	je     c010518f <check_boot_pgdir+0x26d>
c010516b:	c7 44 24 0c f8 6f 10 	movl   $0xc0106ff8,0xc(%esp)
c0105172:	c0 
c0105173:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c010517a:	c0 
c010517b:	c7 44 24 04 0f 02 00 	movl   $0x20f,0x4(%esp)
c0105182:	00 
c0105183:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c010518a:	e8 5f bb ff ff       	call   c0100cee <__panic>
    assert(page_ref(p) == 2);
c010518f:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105192:	89 04 24             	mov    %eax,(%esp)
c0105195:	e8 6d ec ff ff       	call   c0103e07 <page_ref>
c010519a:	83 f8 02             	cmp    $0x2,%eax
c010519d:	74 24                	je     c01051c3 <check_boot_pgdir+0x2a1>
c010519f:	c7 44 24 0c 2f 70 10 	movl   $0xc010702f,0xc(%esp)
c01051a6:	c0 
c01051a7:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c01051ae:	c0 
c01051af:	c7 44 24 04 10 02 00 	movl   $0x210,0x4(%esp)
c01051b6:	00 
c01051b7:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c01051be:	e8 2b bb ff ff       	call   c0100cee <__panic>

    const char *str = "ucore: Hello world!!";
c01051c3:	c7 45 e8 40 70 10 c0 	movl   $0xc0107040,-0x18(%ebp)
    strcpy((void *)0x100, str);
c01051ca:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01051cd:	89 44 24 04          	mov    %eax,0x4(%esp)
c01051d1:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c01051d8:	e8 fc 09 00 00       	call   c0105bd9 <strcpy>
    assert(strcmp((void *)0x100, (void *)(0x100 + PGSIZE)) == 0);
c01051dd:	c7 44 24 04 00 11 00 	movl   $0x1100,0x4(%esp)
c01051e4:	00 
c01051e5:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c01051ec:	e8 60 0a 00 00       	call   c0105c51 <strcmp>
c01051f1:	85 c0                	test   %eax,%eax
c01051f3:	74 24                	je     c0105219 <check_boot_pgdir+0x2f7>
c01051f5:	c7 44 24 0c 58 70 10 	movl   $0xc0107058,0xc(%esp)
c01051fc:	c0 
c01051fd:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c0105204:	c0 
c0105205:	c7 44 24 04 14 02 00 	movl   $0x214,0x4(%esp)
c010520c:	00 
c010520d:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c0105214:	e8 d5 ba ff ff       	call   c0100cee <__panic>

    *(char *)(page2kva(p) + 0x100) = '\0';
c0105219:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010521c:	89 04 24             	mov    %eax,(%esp)
c010521f:	e8 33 eb ff ff       	call   c0103d57 <page2kva>
c0105224:	05 00 01 00 00       	add    $0x100,%eax
c0105229:	c6 00 00             	movb   $0x0,(%eax)
    assert(strlen((const char *)0x100) == 0);
c010522c:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c0105233:	e8 47 09 00 00       	call   c0105b7f <strlen>
c0105238:	85 c0                	test   %eax,%eax
c010523a:	74 24                	je     c0105260 <check_boot_pgdir+0x33e>
c010523c:	c7 44 24 0c 90 70 10 	movl   $0xc0107090,0xc(%esp)
c0105243:	c0 
c0105244:	c7 44 24 08 31 6c 10 	movl   $0xc0106c31,0x8(%esp)
c010524b:	c0 
c010524c:	c7 44 24 04 17 02 00 	movl   $0x217,0x4(%esp)
c0105253:	00 
c0105254:	c7 04 24 0c 6c 10 c0 	movl   $0xc0106c0c,(%esp)
c010525b:	e8 8e ba ff ff       	call   c0100cee <__panic>

    free_page(p);
c0105260:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0105267:	00 
c0105268:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010526b:	89 04 24             	mov    %eax,(%esp)
c010526e:	e8 d0 ed ff ff       	call   c0104043 <free_pages>
    free_page(pde2page(boot_pgdir[0]));
c0105273:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0105278:	8b 00                	mov    (%eax),%eax
c010527a:	89 04 24             	mov    %eax,(%esp)
c010527d:	e8 6b eb ff ff       	call   c0103ded <pde2page>
c0105282:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0105289:	00 
c010528a:	89 04 24             	mov    %eax,(%esp)
c010528d:	e8 b1 ed ff ff       	call   c0104043 <free_pages>
    boot_pgdir[0] = 0;
c0105292:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0105297:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_boot_pgdir() succeeded!\n");
c010529d:	c7 04 24 b4 70 10 c0 	movl   $0xc01070b4,(%esp)
c01052a4:	e8 bd b0 ff ff       	call   c0100366 <cprintf>
}
c01052a9:	90                   	nop
c01052aa:	89 ec                	mov    %ebp,%esp
c01052ac:	5d                   	pop    %ebp
c01052ad:	c3                   	ret    

c01052ae <perm2str>:

//perm2str - use string 'u,r,w,-' to present the permission
static const char *
perm2str(int perm) {
c01052ae:	55                   	push   %ebp
c01052af:	89 e5                	mov    %esp,%ebp
    static char str[4];
    str[0] = (perm & PTE_U) ? 'u' : '-';
c01052b1:	8b 45 08             	mov    0x8(%ebp),%eax
c01052b4:	83 e0 04             	and    $0x4,%eax
c01052b7:	85 c0                	test   %eax,%eax
c01052b9:	74 04                	je     c01052bf <perm2str+0x11>
c01052bb:	b0 75                	mov    $0x75,%al
c01052bd:	eb 02                	jmp    c01052c1 <perm2str+0x13>
c01052bf:	b0 2d                	mov    $0x2d,%al
c01052c1:	a2 48 cf 11 c0       	mov    %al,0xc011cf48
    str[1] = 'r';
c01052c6:	c6 05 49 cf 11 c0 72 	movb   $0x72,0xc011cf49
    str[2] = (perm & PTE_W) ? 'w' : '-';
c01052cd:	8b 45 08             	mov    0x8(%ebp),%eax
c01052d0:	83 e0 02             	and    $0x2,%eax
c01052d3:	85 c0                	test   %eax,%eax
c01052d5:	74 04                	je     c01052db <perm2str+0x2d>
c01052d7:	b0 77                	mov    $0x77,%al
c01052d9:	eb 02                	jmp    c01052dd <perm2str+0x2f>
c01052db:	b0 2d                	mov    $0x2d,%al
c01052dd:	a2 4a cf 11 c0       	mov    %al,0xc011cf4a
    str[3] = '\0';
c01052e2:	c6 05 4b cf 11 c0 00 	movb   $0x0,0xc011cf4b
    return str;
c01052e9:	b8 48 cf 11 c0       	mov    $0xc011cf48,%eax
}
c01052ee:	5d                   	pop    %ebp
c01052ef:	c3                   	ret    

c01052f0 <get_pgtable_items>:
//  table:       the beginning addr of table
//  left_store:  the pointer of the high side of table's next range
//  right_store: the pointer of the low side of table's next range
// return value: 0 - not a invalid item range, perm - a valid item range with perm permission 
static int
get_pgtable_items(size_t left, size_t right, size_t start, uintptr_t *table, size_t *left_store, size_t *right_store) {
c01052f0:	55                   	push   %ebp
c01052f1:	89 e5                	mov    %esp,%ebp
c01052f3:	83 ec 10             	sub    $0x10,%esp
    if (start >= right) {
c01052f6:	8b 45 10             	mov    0x10(%ebp),%eax
c01052f9:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01052fc:	72 0d                	jb     c010530b <get_pgtable_items+0x1b>
        return 0;
c01052fe:	b8 00 00 00 00       	mov    $0x0,%eax
c0105303:	e9 98 00 00 00       	jmp    c01053a0 <get_pgtable_items+0xb0>
    }
    while (start < right && !(table[start] & PTE_P)) {
        start ++;
c0105308:	ff 45 10             	incl   0x10(%ebp)
    while (start < right && !(table[start] & PTE_P)) {
c010530b:	8b 45 10             	mov    0x10(%ebp),%eax
c010530e:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105311:	73 18                	jae    c010532b <get_pgtable_items+0x3b>
c0105313:	8b 45 10             	mov    0x10(%ebp),%eax
c0105316:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c010531d:	8b 45 14             	mov    0x14(%ebp),%eax
c0105320:	01 d0                	add    %edx,%eax
c0105322:	8b 00                	mov    (%eax),%eax
c0105324:	83 e0 01             	and    $0x1,%eax
c0105327:	85 c0                	test   %eax,%eax
c0105329:	74 dd                	je     c0105308 <get_pgtable_items+0x18>
    }
    if (start < right) {
c010532b:	8b 45 10             	mov    0x10(%ebp),%eax
c010532e:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105331:	73 68                	jae    c010539b <get_pgtable_items+0xab>
        if (left_store != NULL) {
c0105333:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
c0105337:	74 08                	je     c0105341 <get_pgtable_items+0x51>
            *left_store = start;
c0105339:	8b 45 18             	mov    0x18(%ebp),%eax
c010533c:	8b 55 10             	mov    0x10(%ebp),%edx
c010533f:	89 10                	mov    %edx,(%eax)
        }
        int perm = (table[start ++] & PTE_USER);
c0105341:	8b 45 10             	mov    0x10(%ebp),%eax
c0105344:	8d 50 01             	lea    0x1(%eax),%edx
c0105347:	89 55 10             	mov    %edx,0x10(%ebp)
c010534a:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0105351:	8b 45 14             	mov    0x14(%ebp),%eax
c0105354:	01 d0                	add    %edx,%eax
c0105356:	8b 00                	mov    (%eax),%eax
c0105358:	83 e0 07             	and    $0x7,%eax
c010535b:	89 45 fc             	mov    %eax,-0x4(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {
c010535e:	eb 03                	jmp    c0105363 <get_pgtable_items+0x73>
            start ++;
c0105360:	ff 45 10             	incl   0x10(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {
c0105363:	8b 45 10             	mov    0x10(%ebp),%eax
c0105366:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105369:	73 1d                	jae    c0105388 <get_pgtable_items+0x98>
c010536b:	8b 45 10             	mov    0x10(%ebp),%eax
c010536e:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0105375:	8b 45 14             	mov    0x14(%ebp),%eax
c0105378:	01 d0                	add    %edx,%eax
c010537a:	8b 00                	mov    (%eax),%eax
c010537c:	83 e0 07             	and    $0x7,%eax
c010537f:	89 c2                	mov    %eax,%edx
c0105381:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105384:	39 c2                	cmp    %eax,%edx
c0105386:	74 d8                	je     c0105360 <get_pgtable_items+0x70>
        }
        if (right_store != NULL) {
c0105388:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c010538c:	74 08                	je     c0105396 <get_pgtable_items+0xa6>
            *right_store = start;
c010538e:	8b 45 1c             	mov    0x1c(%ebp),%eax
c0105391:	8b 55 10             	mov    0x10(%ebp),%edx
c0105394:	89 10                	mov    %edx,(%eax)
        }
        return perm;
c0105396:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105399:	eb 05                	jmp    c01053a0 <get_pgtable_items+0xb0>
    }
    return 0;
c010539b:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01053a0:	89 ec                	mov    %ebp,%esp
c01053a2:	5d                   	pop    %ebp
c01053a3:	c3                   	ret    

c01053a4 <print_pgdir>:

//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
c01053a4:	55                   	push   %ebp
c01053a5:	89 e5                	mov    %esp,%ebp
c01053a7:	57                   	push   %edi
c01053a8:	56                   	push   %esi
c01053a9:	53                   	push   %ebx
c01053aa:	83 ec 4c             	sub    $0x4c,%esp
    cprintf("-------------------- BEGIN --------------------\n");
c01053ad:	c7 04 24 d4 70 10 c0 	movl   $0xc01070d4,(%esp)
c01053b4:	e8 ad af ff ff       	call   c0100366 <cprintf>
    size_t left, right = 0, perm;
c01053b9:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c01053c0:	e9 f2 00 00 00       	jmp    c01054b7 <print_pgdir+0x113>
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c01053c5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01053c8:	89 04 24             	mov    %eax,(%esp)
c01053cb:	e8 de fe ff ff       	call   c01052ae <perm2str>
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
c01053d0:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01053d3:	8b 4d e0             	mov    -0x20(%ebp),%ecx
c01053d6:	29 ca                	sub    %ecx,%edx
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c01053d8:	89 d6                	mov    %edx,%esi
c01053da:	c1 e6 16             	shl    $0x16,%esi
c01053dd:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01053e0:	89 d3                	mov    %edx,%ebx
c01053e2:	c1 e3 16             	shl    $0x16,%ebx
c01053e5:	8b 55 e0             	mov    -0x20(%ebp),%edx
c01053e8:	89 d1                	mov    %edx,%ecx
c01053ea:	c1 e1 16             	shl    $0x16,%ecx
c01053ed:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01053f0:	8b 7d e0             	mov    -0x20(%ebp),%edi
c01053f3:	29 fa                	sub    %edi,%edx
c01053f5:	89 44 24 14          	mov    %eax,0x14(%esp)
c01053f9:	89 74 24 10          	mov    %esi,0x10(%esp)
c01053fd:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c0105401:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0105405:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105409:	c7 04 24 05 71 10 c0 	movl   $0xc0107105,(%esp)
c0105410:	e8 51 af ff ff       	call   c0100366 <cprintf>
        size_t l, r = left * NPTEENTRY;
c0105415:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105418:	c1 e0 0a             	shl    $0xa,%eax
c010541b:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c010541e:	eb 50                	jmp    c0105470 <print_pgdir+0xcc>
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c0105420:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105423:	89 04 24             	mov    %eax,(%esp)
c0105426:	e8 83 fe ff ff       	call   c01052ae <perm2str>
                    l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
c010542b:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010542e:	8b 4d d8             	mov    -0x28(%ebp),%ecx
c0105431:	29 ca                	sub    %ecx,%edx
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c0105433:	89 d6                	mov    %edx,%esi
c0105435:	c1 e6 0c             	shl    $0xc,%esi
c0105438:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010543b:	89 d3                	mov    %edx,%ebx
c010543d:	c1 e3 0c             	shl    $0xc,%ebx
c0105440:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0105443:	89 d1                	mov    %edx,%ecx
c0105445:	c1 e1 0c             	shl    $0xc,%ecx
c0105448:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010544b:	8b 7d d8             	mov    -0x28(%ebp),%edi
c010544e:	29 fa                	sub    %edi,%edx
c0105450:	89 44 24 14          	mov    %eax,0x14(%esp)
c0105454:	89 74 24 10          	mov    %esi,0x10(%esp)
c0105458:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c010545c:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0105460:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105464:	c7 04 24 24 71 10 c0 	movl   $0xc0107124,(%esp)
c010546b:	e8 f6 ae ff ff       	call   c0100366 <cprintf>
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c0105470:	be 00 00 c0 fa       	mov    $0xfac00000,%esi
c0105475:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0105478:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010547b:	89 d3                	mov    %edx,%ebx
c010547d:	c1 e3 0a             	shl    $0xa,%ebx
c0105480:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105483:	89 d1                	mov    %edx,%ecx
c0105485:	c1 e1 0a             	shl    $0xa,%ecx
c0105488:	8d 55 d4             	lea    -0x2c(%ebp),%edx
c010548b:	89 54 24 14          	mov    %edx,0x14(%esp)
c010548f:	8d 55 d8             	lea    -0x28(%ebp),%edx
c0105492:	89 54 24 10          	mov    %edx,0x10(%esp)
c0105496:	89 74 24 0c          	mov    %esi,0xc(%esp)
c010549a:	89 44 24 08          	mov    %eax,0x8(%esp)
c010549e:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c01054a2:	89 0c 24             	mov    %ecx,(%esp)
c01054a5:	e8 46 fe ff ff       	call   c01052f0 <get_pgtable_items>
c01054aa:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01054ad:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01054b1:	0f 85 69 ff ff ff    	jne    c0105420 <print_pgdir+0x7c>
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c01054b7:	b9 00 b0 fe fa       	mov    $0xfafeb000,%ecx
c01054bc:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01054bf:	8d 55 dc             	lea    -0x24(%ebp),%edx
c01054c2:	89 54 24 14          	mov    %edx,0x14(%esp)
c01054c6:	8d 55 e0             	lea    -0x20(%ebp),%edx
c01054c9:	89 54 24 10          	mov    %edx,0x10(%esp)
c01054cd:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c01054d1:	89 44 24 08          	mov    %eax,0x8(%esp)
c01054d5:	c7 44 24 04 00 04 00 	movl   $0x400,0x4(%esp)
c01054dc:	00 
c01054dd:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c01054e4:	e8 07 fe ff ff       	call   c01052f0 <get_pgtable_items>
c01054e9:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01054ec:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01054f0:	0f 85 cf fe ff ff    	jne    c01053c5 <print_pgdir+0x21>
        }
    }
    cprintf("--------------------- END ---------------------\n");
c01054f6:	c7 04 24 48 71 10 c0 	movl   $0xc0107148,(%esp)
c01054fd:	e8 64 ae ff ff       	call   c0100366 <cprintf>
}
c0105502:	90                   	nop
c0105503:	83 c4 4c             	add    $0x4c,%esp
c0105506:	5b                   	pop    %ebx
c0105507:	5e                   	pop    %esi
c0105508:	5f                   	pop    %edi
c0105509:	5d                   	pop    %ebp
c010550a:	c3                   	ret    

c010550b <printnum>:
 * @width:      maximum number of digits, if the actual width is less than @width, use @padc instead
 * @padc:       character that padded on the left if the actual width is less than @width
 * */
static void
printnum(void (*putch)(int, void*), void *putdat,
        unsigned long long num, unsigned base, int width, int padc) {
c010550b:	55                   	push   %ebp
c010550c:	89 e5                	mov    %esp,%ebp
c010550e:	83 ec 58             	sub    $0x58,%esp
c0105511:	8b 45 10             	mov    0x10(%ebp),%eax
c0105514:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0105517:	8b 45 14             	mov    0x14(%ebp),%eax
c010551a:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    unsigned long long result = num;
c010551d:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0105520:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0105523:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105526:	89 55 ec             	mov    %edx,-0x14(%ebp)
    unsigned mod = do_div(result, base);
c0105529:	8b 45 18             	mov    0x18(%ebp),%eax
c010552c:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c010552f:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105532:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0105535:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0105538:	89 55 f0             	mov    %edx,-0x10(%ebp)
c010553b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010553e:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105541:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0105545:	74 1c                	je     c0105563 <printnum+0x58>
c0105547:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010554a:	ba 00 00 00 00       	mov    $0x0,%edx
c010554f:	f7 75 e4             	divl   -0x1c(%ebp)
c0105552:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0105555:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105558:	ba 00 00 00 00       	mov    $0x0,%edx
c010555d:	f7 75 e4             	divl   -0x1c(%ebp)
c0105560:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105563:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105566:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0105569:	f7 75 e4             	divl   -0x1c(%ebp)
c010556c:	89 45 e0             	mov    %eax,-0x20(%ebp)
c010556f:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0105572:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105575:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0105578:	89 45 e8             	mov    %eax,-0x18(%ebp)
c010557b:	89 55 ec             	mov    %edx,-0x14(%ebp)
c010557e:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105581:	89 45 d8             	mov    %eax,-0x28(%ebp)

    // first recursively print all preceding (more significant) digits
    if (num >= base) {
c0105584:	8b 45 18             	mov    0x18(%ebp),%eax
c0105587:	ba 00 00 00 00       	mov    $0x0,%edx
c010558c:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c010558f:	39 45 d0             	cmp    %eax,-0x30(%ebp)
c0105592:	19 d1                	sbb    %edx,%ecx
c0105594:	72 4c                	jb     c01055e2 <printnum+0xd7>
        printnum(putch, putdat, result, base, width - 1, padc);
c0105596:	8b 45 1c             	mov    0x1c(%ebp),%eax
c0105599:	8d 50 ff             	lea    -0x1(%eax),%edx
c010559c:	8b 45 20             	mov    0x20(%ebp),%eax
c010559f:	89 44 24 18          	mov    %eax,0x18(%esp)
c01055a3:	89 54 24 14          	mov    %edx,0x14(%esp)
c01055a7:	8b 45 18             	mov    0x18(%ebp),%eax
c01055aa:	89 44 24 10          	mov    %eax,0x10(%esp)
c01055ae:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01055b1:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01055b4:	89 44 24 08          	mov    %eax,0x8(%esp)
c01055b8:	89 54 24 0c          	mov    %edx,0xc(%esp)
c01055bc:	8b 45 0c             	mov    0xc(%ebp),%eax
c01055bf:	89 44 24 04          	mov    %eax,0x4(%esp)
c01055c3:	8b 45 08             	mov    0x8(%ebp),%eax
c01055c6:	89 04 24             	mov    %eax,(%esp)
c01055c9:	e8 3d ff ff ff       	call   c010550b <printnum>
c01055ce:	eb 1b                	jmp    c01055eb <printnum+0xe0>
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
            putch(padc, putdat);
c01055d0:	8b 45 0c             	mov    0xc(%ebp),%eax
c01055d3:	89 44 24 04          	mov    %eax,0x4(%esp)
c01055d7:	8b 45 20             	mov    0x20(%ebp),%eax
c01055da:	89 04 24             	mov    %eax,(%esp)
c01055dd:	8b 45 08             	mov    0x8(%ebp),%eax
c01055e0:	ff d0                	call   *%eax
        while (-- width > 0)
c01055e2:	ff 4d 1c             	decl   0x1c(%ebp)
c01055e5:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c01055e9:	7f e5                	jg     c01055d0 <printnum+0xc5>
    }
    // then print this (the least significant) digit
    putch("0123456789abcdef"[mod], putdat);
c01055eb:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01055ee:	05 fc 71 10 c0       	add    $0xc01071fc,%eax
c01055f3:	0f b6 00             	movzbl (%eax),%eax
c01055f6:	0f be c0             	movsbl %al,%eax
c01055f9:	8b 55 0c             	mov    0xc(%ebp),%edx
c01055fc:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105600:	89 04 24             	mov    %eax,(%esp)
c0105603:	8b 45 08             	mov    0x8(%ebp),%eax
c0105606:	ff d0                	call   *%eax
}
c0105608:	90                   	nop
c0105609:	89 ec                	mov    %ebp,%esp
c010560b:	5d                   	pop    %ebp
c010560c:	c3                   	ret    

c010560d <getuint>:
 * getuint - get an unsigned int of various possible sizes from a varargs list
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static unsigned long long
getuint(va_list *ap, int lflag) {
c010560d:	55                   	push   %ebp
c010560e:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
c0105610:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c0105614:	7e 14                	jle    c010562a <getuint+0x1d>
        return va_arg(*ap, unsigned long long);
c0105616:	8b 45 08             	mov    0x8(%ebp),%eax
c0105619:	8b 00                	mov    (%eax),%eax
c010561b:	8d 48 08             	lea    0x8(%eax),%ecx
c010561e:	8b 55 08             	mov    0x8(%ebp),%edx
c0105621:	89 0a                	mov    %ecx,(%edx)
c0105623:	8b 50 04             	mov    0x4(%eax),%edx
c0105626:	8b 00                	mov    (%eax),%eax
c0105628:	eb 30                	jmp    c010565a <getuint+0x4d>
    }
    else if (lflag) {
c010562a:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c010562e:	74 16                	je     c0105646 <getuint+0x39>
        return va_arg(*ap, unsigned long);
c0105630:	8b 45 08             	mov    0x8(%ebp),%eax
c0105633:	8b 00                	mov    (%eax),%eax
c0105635:	8d 48 04             	lea    0x4(%eax),%ecx
c0105638:	8b 55 08             	mov    0x8(%ebp),%edx
c010563b:	89 0a                	mov    %ecx,(%edx)
c010563d:	8b 00                	mov    (%eax),%eax
c010563f:	ba 00 00 00 00       	mov    $0x0,%edx
c0105644:	eb 14                	jmp    c010565a <getuint+0x4d>
    }
    else {
        return va_arg(*ap, unsigned int);
c0105646:	8b 45 08             	mov    0x8(%ebp),%eax
c0105649:	8b 00                	mov    (%eax),%eax
c010564b:	8d 48 04             	lea    0x4(%eax),%ecx
c010564e:	8b 55 08             	mov    0x8(%ebp),%edx
c0105651:	89 0a                	mov    %ecx,(%edx)
c0105653:	8b 00                	mov    (%eax),%eax
c0105655:	ba 00 00 00 00       	mov    $0x0,%edx
    }
}
c010565a:	5d                   	pop    %ebp
c010565b:	c3                   	ret    

c010565c <getint>:
 * getint - same as getuint but signed, we can't use getuint because of sign extension
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static long long
getint(va_list *ap, int lflag) {
c010565c:	55                   	push   %ebp
c010565d:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
c010565f:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c0105663:	7e 14                	jle    c0105679 <getint+0x1d>
        return va_arg(*ap, long long);
c0105665:	8b 45 08             	mov    0x8(%ebp),%eax
c0105668:	8b 00                	mov    (%eax),%eax
c010566a:	8d 48 08             	lea    0x8(%eax),%ecx
c010566d:	8b 55 08             	mov    0x8(%ebp),%edx
c0105670:	89 0a                	mov    %ecx,(%edx)
c0105672:	8b 50 04             	mov    0x4(%eax),%edx
c0105675:	8b 00                	mov    (%eax),%eax
c0105677:	eb 28                	jmp    c01056a1 <getint+0x45>
    }
    else if (lflag) {
c0105679:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c010567d:	74 12                	je     c0105691 <getint+0x35>
        return va_arg(*ap, long);
c010567f:	8b 45 08             	mov    0x8(%ebp),%eax
c0105682:	8b 00                	mov    (%eax),%eax
c0105684:	8d 48 04             	lea    0x4(%eax),%ecx
c0105687:	8b 55 08             	mov    0x8(%ebp),%edx
c010568a:	89 0a                	mov    %ecx,(%edx)
c010568c:	8b 00                	mov    (%eax),%eax
c010568e:	99                   	cltd   
c010568f:	eb 10                	jmp    c01056a1 <getint+0x45>
    }
    else {
        return va_arg(*ap, int);
c0105691:	8b 45 08             	mov    0x8(%ebp),%eax
c0105694:	8b 00                	mov    (%eax),%eax
c0105696:	8d 48 04             	lea    0x4(%eax),%ecx
c0105699:	8b 55 08             	mov    0x8(%ebp),%edx
c010569c:	89 0a                	mov    %ecx,(%edx)
c010569e:	8b 00                	mov    (%eax),%eax
c01056a0:	99                   	cltd   
    }
}
c01056a1:	5d                   	pop    %ebp
c01056a2:	c3                   	ret    

c01056a3 <printfmt>:
 * @putch:      specified putch function, print a single character
 * @putdat:     used by @putch function
 * @fmt:        the format string to use
 * */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
c01056a3:	55                   	push   %ebp
c01056a4:	89 e5                	mov    %esp,%ebp
c01056a6:	83 ec 28             	sub    $0x28,%esp
    va_list ap;

    va_start(ap, fmt);
c01056a9:	8d 45 14             	lea    0x14(%ebp),%eax
c01056ac:	89 45 f4             	mov    %eax,-0xc(%ebp)
    vprintfmt(putch, putdat, fmt, ap);
c01056af:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01056b2:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01056b6:	8b 45 10             	mov    0x10(%ebp),%eax
c01056b9:	89 44 24 08          	mov    %eax,0x8(%esp)
c01056bd:	8b 45 0c             	mov    0xc(%ebp),%eax
c01056c0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01056c4:	8b 45 08             	mov    0x8(%ebp),%eax
c01056c7:	89 04 24             	mov    %eax,(%esp)
c01056ca:	e8 05 00 00 00       	call   c01056d4 <vprintfmt>
    va_end(ap);
}
c01056cf:	90                   	nop
c01056d0:	89 ec                	mov    %ebp,%esp
c01056d2:	5d                   	pop    %ebp
c01056d3:	c3                   	ret    

c01056d4 <vprintfmt>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want printfmt() instead.
 * */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
c01056d4:	55                   	push   %ebp
c01056d5:	89 e5                	mov    %esp,%ebp
c01056d7:	56                   	push   %esi
c01056d8:	53                   	push   %ebx
c01056d9:	83 ec 40             	sub    $0x40,%esp
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c01056dc:	eb 17                	jmp    c01056f5 <vprintfmt+0x21>
            if (ch == '\0') {
c01056de:	85 db                	test   %ebx,%ebx
c01056e0:	0f 84 bf 03 00 00    	je     c0105aa5 <vprintfmt+0x3d1>
                return;
            }
            putch(ch, putdat);
c01056e6:	8b 45 0c             	mov    0xc(%ebp),%eax
c01056e9:	89 44 24 04          	mov    %eax,0x4(%esp)
c01056ed:	89 1c 24             	mov    %ebx,(%esp)
c01056f0:	8b 45 08             	mov    0x8(%ebp),%eax
c01056f3:	ff d0                	call   *%eax
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c01056f5:	8b 45 10             	mov    0x10(%ebp),%eax
c01056f8:	8d 50 01             	lea    0x1(%eax),%edx
c01056fb:	89 55 10             	mov    %edx,0x10(%ebp)
c01056fe:	0f b6 00             	movzbl (%eax),%eax
c0105701:	0f b6 d8             	movzbl %al,%ebx
c0105704:	83 fb 25             	cmp    $0x25,%ebx
c0105707:	75 d5                	jne    c01056de <vprintfmt+0xa>
        }

        // Process a %-escape sequence
        char padc = ' ';
c0105709:	c6 45 db 20          	movb   $0x20,-0x25(%ebp)
        width = precision = -1;
c010570d:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
c0105714:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105717:	89 45 e8             	mov    %eax,-0x18(%ebp)
        lflag = altflag = 0;
c010571a:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0105721:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105724:	89 45 e0             	mov    %eax,-0x20(%ebp)

    reswitch:
        switch (ch = *(unsigned char *)fmt ++) {
c0105727:	8b 45 10             	mov    0x10(%ebp),%eax
c010572a:	8d 50 01             	lea    0x1(%eax),%edx
c010572d:	89 55 10             	mov    %edx,0x10(%ebp)
c0105730:	0f b6 00             	movzbl (%eax),%eax
c0105733:	0f b6 d8             	movzbl %al,%ebx
c0105736:	8d 43 dd             	lea    -0x23(%ebx),%eax
c0105739:	83 f8 55             	cmp    $0x55,%eax
c010573c:	0f 87 37 03 00 00    	ja     c0105a79 <vprintfmt+0x3a5>
c0105742:	8b 04 85 20 72 10 c0 	mov    -0x3fef8de0(,%eax,4),%eax
c0105749:	ff e0                	jmp    *%eax

        // flag to pad on the right
        case '-':
            padc = '-';
c010574b:	c6 45 db 2d          	movb   $0x2d,-0x25(%ebp)
            goto reswitch;
c010574f:	eb d6                	jmp    c0105727 <vprintfmt+0x53>

        // flag to pad with 0's instead of spaces
        case '0':
            padc = '0';
c0105751:	c6 45 db 30          	movb   $0x30,-0x25(%ebp)
            goto reswitch;
c0105755:	eb d0                	jmp    c0105727 <vprintfmt+0x53>

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
c0105757:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
                precision = precision * 10 + ch - '0';
c010575e:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0105761:	89 d0                	mov    %edx,%eax
c0105763:	c1 e0 02             	shl    $0x2,%eax
c0105766:	01 d0                	add    %edx,%eax
c0105768:	01 c0                	add    %eax,%eax
c010576a:	01 d8                	add    %ebx,%eax
c010576c:	83 e8 30             	sub    $0x30,%eax
c010576f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
                ch = *fmt;
c0105772:	8b 45 10             	mov    0x10(%ebp),%eax
c0105775:	0f b6 00             	movzbl (%eax),%eax
c0105778:	0f be d8             	movsbl %al,%ebx
                if (ch < '0' || ch > '9') {
c010577b:	83 fb 2f             	cmp    $0x2f,%ebx
c010577e:	7e 38                	jle    c01057b8 <vprintfmt+0xe4>
c0105780:	83 fb 39             	cmp    $0x39,%ebx
c0105783:	7f 33                	jg     c01057b8 <vprintfmt+0xe4>
            for (precision = 0; ; ++ fmt) {
c0105785:	ff 45 10             	incl   0x10(%ebp)
                precision = precision * 10 + ch - '0';
c0105788:	eb d4                	jmp    c010575e <vprintfmt+0x8a>
                }
            }
            goto process_precision;

        case '*':
            precision = va_arg(ap, int);
c010578a:	8b 45 14             	mov    0x14(%ebp),%eax
c010578d:	8d 50 04             	lea    0x4(%eax),%edx
c0105790:	89 55 14             	mov    %edx,0x14(%ebp)
c0105793:	8b 00                	mov    (%eax),%eax
c0105795:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            goto process_precision;
c0105798:	eb 1f                	jmp    c01057b9 <vprintfmt+0xe5>

        case '.':
            if (width < 0)
c010579a:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c010579e:	79 87                	jns    c0105727 <vprintfmt+0x53>
                width = 0;
c01057a0:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
            goto reswitch;
c01057a7:	e9 7b ff ff ff       	jmp    c0105727 <vprintfmt+0x53>

        case '#':
            altflag = 1;
c01057ac:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
            goto reswitch;
c01057b3:	e9 6f ff ff ff       	jmp    c0105727 <vprintfmt+0x53>
            goto process_precision;
c01057b8:	90                   	nop

        process_precision:
            if (width < 0)
c01057b9:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01057bd:	0f 89 64 ff ff ff    	jns    c0105727 <vprintfmt+0x53>
                width = precision, precision = -1;
c01057c3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01057c6:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01057c9:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
            goto reswitch;
c01057d0:	e9 52 ff ff ff       	jmp    c0105727 <vprintfmt+0x53>

        // long flag (doubled for long long)
        case 'l':
            lflag ++;
c01057d5:	ff 45 e0             	incl   -0x20(%ebp)
            goto reswitch;
c01057d8:	e9 4a ff ff ff       	jmp    c0105727 <vprintfmt+0x53>

        // character
        case 'c':
            putch(va_arg(ap, int), putdat);
c01057dd:	8b 45 14             	mov    0x14(%ebp),%eax
c01057e0:	8d 50 04             	lea    0x4(%eax),%edx
c01057e3:	89 55 14             	mov    %edx,0x14(%ebp)
c01057e6:	8b 00                	mov    (%eax),%eax
c01057e8:	8b 55 0c             	mov    0xc(%ebp),%edx
c01057eb:	89 54 24 04          	mov    %edx,0x4(%esp)
c01057ef:	89 04 24             	mov    %eax,(%esp)
c01057f2:	8b 45 08             	mov    0x8(%ebp),%eax
c01057f5:	ff d0                	call   *%eax
            break;
c01057f7:	e9 a4 02 00 00       	jmp    c0105aa0 <vprintfmt+0x3cc>

        // error message
        case 'e':
            err = va_arg(ap, int);
c01057fc:	8b 45 14             	mov    0x14(%ebp),%eax
c01057ff:	8d 50 04             	lea    0x4(%eax),%edx
c0105802:	89 55 14             	mov    %edx,0x14(%ebp)
c0105805:	8b 18                	mov    (%eax),%ebx
            if (err < 0) {
c0105807:	85 db                	test   %ebx,%ebx
c0105809:	79 02                	jns    c010580d <vprintfmt+0x139>
                err = -err;
c010580b:	f7 db                	neg    %ebx
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
c010580d:	83 fb 06             	cmp    $0x6,%ebx
c0105810:	7f 0b                	jg     c010581d <vprintfmt+0x149>
c0105812:	8b 34 9d e0 71 10 c0 	mov    -0x3fef8e20(,%ebx,4),%esi
c0105819:	85 f6                	test   %esi,%esi
c010581b:	75 23                	jne    c0105840 <vprintfmt+0x16c>
                printfmt(putch, putdat, "error %d", err);
c010581d:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c0105821:	c7 44 24 08 0d 72 10 	movl   $0xc010720d,0x8(%esp)
c0105828:	c0 
c0105829:	8b 45 0c             	mov    0xc(%ebp),%eax
c010582c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105830:	8b 45 08             	mov    0x8(%ebp),%eax
c0105833:	89 04 24             	mov    %eax,(%esp)
c0105836:	e8 68 fe ff ff       	call   c01056a3 <printfmt>
            }
            else {
                printfmt(putch, putdat, "%s", p);
            }
            break;
c010583b:	e9 60 02 00 00       	jmp    c0105aa0 <vprintfmt+0x3cc>
                printfmt(putch, putdat, "%s", p);
c0105840:	89 74 24 0c          	mov    %esi,0xc(%esp)
c0105844:	c7 44 24 08 16 72 10 	movl   $0xc0107216,0x8(%esp)
c010584b:	c0 
c010584c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010584f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105853:	8b 45 08             	mov    0x8(%ebp),%eax
c0105856:	89 04 24             	mov    %eax,(%esp)
c0105859:	e8 45 fe ff ff       	call   c01056a3 <printfmt>
            break;
c010585e:	e9 3d 02 00 00       	jmp    c0105aa0 <vprintfmt+0x3cc>

        // string
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
c0105863:	8b 45 14             	mov    0x14(%ebp),%eax
c0105866:	8d 50 04             	lea    0x4(%eax),%edx
c0105869:	89 55 14             	mov    %edx,0x14(%ebp)
c010586c:	8b 30                	mov    (%eax),%esi
c010586e:	85 f6                	test   %esi,%esi
c0105870:	75 05                	jne    c0105877 <vprintfmt+0x1a3>
                p = "(null)";
c0105872:	be 19 72 10 c0       	mov    $0xc0107219,%esi
            }
            if (width > 0 && padc != '-') {
c0105877:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c010587b:	7e 76                	jle    c01058f3 <vprintfmt+0x21f>
c010587d:	80 7d db 2d          	cmpb   $0x2d,-0x25(%ebp)
c0105881:	74 70                	je     c01058f3 <vprintfmt+0x21f>
                for (width -= strnlen(p, precision); width > 0; width --) {
c0105883:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105886:	89 44 24 04          	mov    %eax,0x4(%esp)
c010588a:	89 34 24             	mov    %esi,(%esp)
c010588d:	e8 16 03 00 00       	call   c0105ba8 <strnlen>
c0105892:	89 c2                	mov    %eax,%edx
c0105894:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105897:	29 d0                	sub    %edx,%eax
c0105899:	89 45 e8             	mov    %eax,-0x18(%ebp)
c010589c:	eb 16                	jmp    c01058b4 <vprintfmt+0x1e0>
                    putch(padc, putdat);
c010589e:	0f be 45 db          	movsbl -0x25(%ebp),%eax
c01058a2:	8b 55 0c             	mov    0xc(%ebp),%edx
c01058a5:	89 54 24 04          	mov    %edx,0x4(%esp)
c01058a9:	89 04 24             	mov    %eax,(%esp)
c01058ac:	8b 45 08             	mov    0x8(%ebp),%eax
c01058af:	ff d0                	call   *%eax
                for (width -= strnlen(p, precision); width > 0; width --) {
c01058b1:	ff 4d e8             	decl   -0x18(%ebp)
c01058b4:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01058b8:	7f e4                	jg     c010589e <vprintfmt+0x1ca>
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c01058ba:	eb 37                	jmp    c01058f3 <vprintfmt+0x21f>
                if (altflag && (ch < ' ' || ch > '~')) {
c01058bc:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c01058c0:	74 1f                	je     c01058e1 <vprintfmt+0x20d>
c01058c2:	83 fb 1f             	cmp    $0x1f,%ebx
c01058c5:	7e 05                	jle    c01058cc <vprintfmt+0x1f8>
c01058c7:	83 fb 7e             	cmp    $0x7e,%ebx
c01058ca:	7e 15                	jle    c01058e1 <vprintfmt+0x20d>
                    putch('?', putdat);
c01058cc:	8b 45 0c             	mov    0xc(%ebp),%eax
c01058cf:	89 44 24 04          	mov    %eax,0x4(%esp)
c01058d3:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
c01058da:	8b 45 08             	mov    0x8(%ebp),%eax
c01058dd:	ff d0                	call   *%eax
c01058df:	eb 0f                	jmp    c01058f0 <vprintfmt+0x21c>
                }
                else {
                    putch(ch, putdat);
c01058e1:	8b 45 0c             	mov    0xc(%ebp),%eax
c01058e4:	89 44 24 04          	mov    %eax,0x4(%esp)
c01058e8:	89 1c 24             	mov    %ebx,(%esp)
c01058eb:	8b 45 08             	mov    0x8(%ebp),%eax
c01058ee:	ff d0                	call   *%eax
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c01058f0:	ff 4d e8             	decl   -0x18(%ebp)
c01058f3:	89 f0                	mov    %esi,%eax
c01058f5:	8d 70 01             	lea    0x1(%eax),%esi
c01058f8:	0f b6 00             	movzbl (%eax),%eax
c01058fb:	0f be d8             	movsbl %al,%ebx
c01058fe:	85 db                	test   %ebx,%ebx
c0105900:	74 27                	je     c0105929 <vprintfmt+0x255>
c0105902:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0105906:	78 b4                	js     c01058bc <vprintfmt+0x1e8>
c0105908:	ff 4d e4             	decl   -0x1c(%ebp)
c010590b:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c010590f:	79 ab                	jns    c01058bc <vprintfmt+0x1e8>
                }
            }
            for (; width > 0; width --) {
c0105911:	eb 16                	jmp    c0105929 <vprintfmt+0x255>
                putch(' ', putdat);
c0105913:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105916:	89 44 24 04          	mov    %eax,0x4(%esp)
c010591a:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c0105921:	8b 45 08             	mov    0x8(%ebp),%eax
c0105924:	ff d0                	call   *%eax
            for (; width > 0; width --) {
c0105926:	ff 4d e8             	decl   -0x18(%ebp)
c0105929:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c010592d:	7f e4                	jg     c0105913 <vprintfmt+0x23f>
            }
            break;
c010592f:	e9 6c 01 00 00       	jmp    c0105aa0 <vprintfmt+0x3cc>

        // (signed) decimal
        case 'd':
            num = getint(&ap, lflag);
c0105934:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105937:	89 44 24 04          	mov    %eax,0x4(%esp)
c010593b:	8d 45 14             	lea    0x14(%ebp),%eax
c010593e:	89 04 24             	mov    %eax,(%esp)
c0105941:	e8 16 fd ff ff       	call   c010565c <getint>
c0105946:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105949:	89 55 f4             	mov    %edx,-0xc(%ebp)
            if ((long long)num < 0) {
c010594c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010594f:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0105952:	85 d2                	test   %edx,%edx
c0105954:	79 26                	jns    c010597c <vprintfmt+0x2a8>
                putch('-', putdat);
c0105956:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105959:	89 44 24 04          	mov    %eax,0x4(%esp)
c010595d:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
c0105964:	8b 45 08             	mov    0x8(%ebp),%eax
c0105967:	ff d0                	call   *%eax
                num = -(long long)num;
c0105969:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010596c:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010596f:	f7 d8                	neg    %eax
c0105971:	83 d2 00             	adc    $0x0,%edx
c0105974:	f7 da                	neg    %edx
c0105976:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105979:	89 55 f4             	mov    %edx,-0xc(%ebp)
            }
            base = 10;
c010597c:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
c0105983:	e9 a8 00 00 00       	jmp    c0105a30 <vprintfmt+0x35c>

        // unsigned decimal
        case 'u':
            num = getuint(&ap, lflag);
c0105988:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010598b:	89 44 24 04          	mov    %eax,0x4(%esp)
c010598f:	8d 45 14             	lea    0x14(%ebp),%eax
c0105992:	89 04 24             	mov    %eax,(%esp)
c0105995:	e8 73 fc ff ff       	call   c010560d <getuint>
c010599a:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010599d:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 10;
c01059a0:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
c01059a7:	e9 84 00 00 00       	jmp    c0105a30 <vprintfmt+0x35c>

        // (unsigned) octal
        case 'o':
            num = getuint(&ap, lflag);
c01059ac:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01059af:	89 44 24 04          	mov    %eax,0x4(%esp)
c01059b3:	8d 45 14             	lea    0x14(%ebp),%eax
c01059b6:	89 04 24             	mov    %eax,(%esp)
c01059b9:	e8 4f fc ff ff       	call   c010560d <getuint>
c01059be:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01059c1:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 8;
c01059c4:	c7 45 ec 08 00 00 00 	movl   $0x8,-0x14(%ebp)
            goto number;
c01059cb:	eb 63                	jmp    c0105a30 <vprintfmt+0x35c>

        // pointer
        case 'p':
            putch('0', putdat);
c01059cd:	8b 45 0c             	mov    0xc(%ebp),%eax
c01059d0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01059d4:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
c01059db:	8b 45 08             	mov    0x8(%ebp),%eax
c01059de:	ff d0                	call   *%eax
            putch('x', putdat);
c01059e0:	8b 45 0c             	mov    0xc(%ebp),%eax
c01059e3:	89 44 24 04          	mov    %eax,0x4(%esp)
c01059e7:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
c01059ee:	8b 45 08             	mov    0x8(%ebp),%eax
c01059f1:	ff d0                	call   *%eax
            num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
c01059f3:	8b 45 14             	mov    0x14(%ebp),%eax
c01059f6:	8d 50 04             	lea    0x4(%eax),%edx
c01059f9:	89 55 14             	mov    %edx,0x14(%ebp)
c01059fc:	8b 00                	mov    (%eax),%eax
c01059fe:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105a01:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
            base = 16;
c0105a08:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
            goto number;
c0105a0f:	eb 1f                	jmp    c0105a30 <vprintfmt+0x35c>

        // (unsigned) hexadecimal
        case 'x':
            num = getuint(&ap, lflag);
c0105a11:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105a14:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a18:	8d 45 14             	lea    0x14(%ebp),%eax
c0105a1b:	89 04 24             	mov    %eax,(%esp)
c0105a1e:	e8 ea fb ff ff       	call   c010560d <getuint>
c0105a23:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105a26:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 16;
c0105a29:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
        number:
            printnum(putch, putdat, num, base, width, padc);
c0105a30:	0f be 55 db          	movsbl -0x25(%ebp),%edx
c0105a34:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105a37:	89 54 24 18          	mov    %edx,0x18(%esp)
c0105a3b:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0105a3e:	89 54 24 14          	mov    %edx,0x14(%esp)
c0105a42:	89 44 24 10          	mov    %eax,0x10(%esp)
c0105a46:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105a49:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0105a4c:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105a50:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0105a54:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a57:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a5b:	8b 45 08             	mov    0x8(%ebp),%eax
c0105a5e:	89 04 24             	mov    %eax,(%esp)
c0105a61:	e8 a5 fa ff ff       	call   c010550b <printnum>
            break;
c0105a66:	eb 38                	jmp    c0105aa0 <vprintfmt+0x3cc>

        // escaped '%' character
        case '%':
            putch(ch, putdat);
c0105a68:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a6b:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a6f:	89 1c 24             	mov    %ebx,(%esp)
c0105a72:	8b 45 08             	mov    0x8(%ebp),%eax
c0105a75:	ff d0                	call   *%eax
            break;
c0105a77:	eb 27                	jmp    c0105aa0 <vprintfmt+0x3cc>

        // unrecognized escape sequence - just print it literally
        default:
            putch('%', putdat);
c0105a79:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a7c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a80:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
c0105a87:	8b 45 08             	mov    0x8(%ebp),%eax
c0105a8a:	ff d0                	call   *%eax
            for (fmt --; fmt[-1] != '%'; fmt --)
c0105a8c:	ff 4d 10             	decl   0x10(%ebp)
c0105a8f:	eb 03                	jmp    c0105a94 <vprintfmt+0x3c0>
c0105a91:	ff 4d 10             	decl   0x10(%ebp)
c0105a94:	8b 45 10             	mov    0x10(%ebp),%eax
c0105a97:	48                   	dec    %eax
c0105a98:	0f b6 00             	movzbl (%eax),%eax
c0105a9b:	3c 25                	cmp    $0x25,%al
c0105a9d:	75 f2                	jne    c0105a91 <vprintfmt+0x3bd>
                /* do nothing */;
            break;
c0105a9f:	90                   	nop
    while (1) {
c0105aa0:	e9 37 fc ff ff       	jmp    c01056dc <vprintfmt+0x8>
                return;
c0105aa5:	90                   	nop
        }
    }
}
c0105aa6:	83 c4 40             	add    $0x40,%esp
c0105aa9:	5b                   	pop    %ebx
c0105aaa:	5e                   	pop    %esi
c0105aab:	5d                   	pop    %ebp
c0105aac:	c3                   	ret    

c0105aad <sprintputch>:
 * sprintputch - 'print' a single character in a buffer
 * @ch:         the character will be printed
 * @b:          the buffer to place the character @ch
 * */
static void
sprintputch(int ch, struct sprintbuf *b) {
c0105aad:	55                   	push   %ebp
c0105aae:	89 e5                	mov    %esp,%ebp
    b->cnt ++;
c0105ab0:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105ab3:	8b 40 08             	mov    0x8(%eax),%eax
c0105ab6:	8d 50 01             	lea    0x1(%eax),%edx
c0105ab9:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105abc:	89 50 08             	mov    %edx,0x8(%eax)
    if (b->buf < b->ebuf) {
c0105abf:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105ac2:	8b 10                	mov    (%eax),%edx
c0105ac4:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105ac7:	8b 40 04             	mov    0x4(%eax),%eax
c0105aca:	39 c2                	cmp    %eax,%edx
c0105acc:	73 12                	jae    c0105ae0 <sprintputch+0x33>
        *b->buf ++ = ch;
c0105ace:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105ad1:	8b 00                	mov    (%eax),%eax
c0105ad3:	8d 48 01             	lea    0x1(%eax),%ecx
c0105ad6:	8b 55 0c             	mov    0xc(%ebp),%edx
c0105ad9:	89 0a                	mov    %ecx,(%edx)
c0105adb:	8b 55 08             	mov    0x8(%ebp),%edx
c0105ade:	88 10                	mov    %dl,(%eax)
    }
}
c0105ae0:	90                   	nop
c0105ae1:	5d                   	pop    %ebp
c0105ae2:	c3                   	ret    

c0105ae3 <snprintf>:
 * @str:        the buffer to place the result into
 * @size:       the size of buffer, including the trailing null space
 * @fmt:        the format string to use
 * */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
c0105ae3:	55                   	push   %ebp
c0105ae4:	89 e5                	mov    %esp,%ebp
c0105ae6:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
c0105ae9:	8d 45 14             	lea    0x14(%ebp),%eax
c0105aec:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vsnprintf(str, size, fmt, ap);
c0105aef:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105af2:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105af6:	8b 45 10             	mov    0x10(%ebp),%eax
c0105af9:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105afd:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105b00:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105b04:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b07:	89 04 24             	mov    %eax,(%esp)
c0105b0a:	e8 0a 00 00 00       	call   c0105b19 <vsnprintf>
c0105b0f:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
c0105b12:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0105b15:	89 ec                	mov    %ebp,%esp
c0105b17:	5d                   	pop    %ebp
c0105b18:	c3                   	ret    

c0105b19 <vsnprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want snprintf() instead.
 * */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
c0105b19:	55                   	push   %ebp
c0105b1a:	89 e5                	mov    %esp,%ebp
c0105b1c:	83 ec 28             	sub    $0x28,%esp
    struct sprintbuf b = {str, str + size - 1, 0};
c0105b1f:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b22:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105b25:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105b28:	8d 50 ff             	lea    -0x1(%eax),%edx
c0105b2b:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b2e:	01 d0                	add    %edx,%eax
c0105b30:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105b33:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    if (str == NULL || b.buf > b.ebuf) {
c0105b3a:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0105b3e:	74 0a                	je     c0105b4a <vsnprintf+0x31>
c0105b40:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0105b43:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105b46:	39 c2                	cmp    %eax,%edx
c0105b48:	76 07                	jbe    c0105b51 <vsnprintf+0x38>
        return -E_INVAL;
c0105b4a:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
c0105b4f:	eb 2a                	jmp    c0105b7b <vsnprintf+0x62>
    }
    // print the string to the buffer
    vprintfmt((void*)sprintputch, &b, fmt, ap);
c0105b51:	8b 45 14             	mov    0x14(%ebp),%eax
c0105b54:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105b58:	8b 45 10             	mov    0x10(%ebp),%eax
c0105b5b:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105b5f:	8d 45 ec             	lea    -0x14(%ebp),%eax
c0105b62:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105b66:	c7 04 24 ad 5a 10 c0 	movl   $0xc0105aad,(%esp)
c0105b6d:	e8 62 fb ff ff       	call   c01056d4 <vprintfmt>
    // null terminate the buffer
    *b.buf = '\0';
c0105b72:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105b75:	c6 00 00             	movb   $0x0,(%eax)
    return b.cnt;
c0105b78:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0105b7b:	89 ec                	mov    %ebp,%esp
c0105b7d:	5d                   	pop    %ebp
c0105b7e:	c3                   	ret    

c0105b7f <strlen>:
 * @s:      the input string
 *
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
c0105b7f:	55                   	push   %ebp
c0105b80:	89 e5                	mov    %esp,%ebp
c0105b82:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
c0105b85:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (*s ++ != '\0') {
c0105b8c:	eb 03                	jmp    c0105b91 <strlen+0x12>
        cnt ++;
c0105b8e:	ff 45 fc             	incl   -0x4(%ebp)
    while (*s ++ != '\0') {
c0105b91:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b94:	8d 50 01             	lea    0x1(%eax),%edx
c0105b97:	89 55 08             	mov    %edx,0x8(%ebp)
c0105b9a:	0f b6 00             	movzbl (%eax),%eax
c0105b9d:	84 c0                	test   %al,%al
c0105b9f:	75 ed                	jne    c0105b8e <strlen+0xf>
    }
    return cnt;
c0105ba1:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0105ba4:	89 ec                	mov    %ebp,%esp
c0105ba6:	5d                   	pop    %ebp
c0105ba7:	c3                   	ret    

c0105ba8 <strnlen>:
 * The return value is strlen(s), if that is less than @len, or
 * @len if there is no '\0' character among the first @len characters
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
c0105ba8:	55                   	push   %ebp
c0105ba9:	89 e5                	mov    %esp,%ebp
c0105bab:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
c0105bae:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
c0105bb5:	eb 03                	jmp    c0105bba <strnlen+0x12>
        cnt ++;
c0105bb7:	ff 45 fc             	incl   -0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
c0105bba:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105bbd:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105bc0:	73 10                	jae    c0105bd2 <strnlen+0x2a>
c0105bc2:	8b 45 08             	mov    0x8(%ebp),%eax
c0105bc5:	8d 50 01             	lea    0x1(%eax),%edx
c0105bc8:	89 55 08             	mov    %edx,0x8(%ebp)
c0105bcb:	0f b6 00             	movzbl (%eax),%eax
c0105bce:	84 c0                	test   %al,%al
c0105bd0:	75 e5                	jne    c0105bb7 <strnlen+0xf>
    }
    return cnt;
c0105bd2:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0105bd5:	89 ec                	mov    %ebp,%esp
c0105bd7:	5d                   	pop    %ebp
c0105bd8:	c3                   	ret    

c0105bd9 <strcpy>:
 * To avoid overflows, the size of array pointed by @dst should be long enough to
 * contain the same string as @src (including the terminating null character), and
 * should not overlap in memory with @src.
 * */
char *
strcpy(char *dst, const char *src) {
c0105bd9:	55                   	push   %ebp
c0105bda:	89 e5                	mov    %esp,%ebp
c0105bdc:	57                   	push   %edi
c0105bdd:	56                   	push   %esi
c0105bde:	83 ec 20             	sub    $0x20,%esp
c0105be1:	8b 45 08             	mov    0x8(%ebp),%eax
c0105be4:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105be7:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105bea:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
    int d0, d1, d2;
    asm volatile (
c0105bed:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0105bf0:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105bf3:	89 d1                	mov    %edx,%ecx
c0105bf5:	89 c2                	mov    %eax,%edx
c0105bf7:	89 ce                	mov    %ecx,%esi
c0105bf9:	89 d7                	mov    %edx,%edi
c0105bfb:	ac                   	lods   %ds:(%esi),%al
c0105bfc:	aa                   	stos   %al,%es:(%edi)
c0105bfd:	84 c0                	test   %al,%al
c0105bff:	75 fa                	jne    c0105bfb <strcpy+0x22>
c0105c01:	89 fa                	mov    %edi,%edx
c0105c03:	89 f1                	mov    %esi,%ecx
c0105c05:	89 4d ec             	mov    %ecx,-0x14(%ebp)
c0105c08:	89 55 e8             	mov    %edx,-0x18(%ebp)
c0105c0b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        "stosb;"
        "testb %%al, %%al;"
        "jne 1b;"
        : "=&S" (d0), "=&D" (d1), "=&a" (d2)
        : "0" (src), "1" (dst) : "memory");
    return dst;
c0105c0e:	8b 45 f4             	mov    -0xc(%ebp),%eax
    char *p = dst;
    while ((*p ++ = *src ++) != '\0')
        /* nothing */;
    return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
c0105c11:	83 c4 20             	add    $0x20,%esp
c0105c14:	5e                   	pop    %esi
c0105c15:	5f                   	pop    %edi
c0105c16:	5d                   	pop    %ebp
c0105c17:	c3                   	ret    

c0105c18 <strncpy>:
 * @len:    maximum number of characters to be copied from @src
 *
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
c0105c18:	55                   	push   %ebp
c0105c19:	89 e5                	mov    %esp,%ebp
c0105c1b:	83 ec 10             	sub    $0x10,%esp
    char *p = dst;
c0105c1e:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c21:	89 45 fc             	mov    %eax,-0x4(%ebp)
    while (len > 0) {
c0105c24:	eb 1e                	jmp    c0105c44 <strncpy+0x2c>
        if ((*p = *src) != '\0') {
c0105c26:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105c29:	0f b6 10             	movzbl (%eax),%edx
c0105c2c:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105c2f:	88 10                	mov    %dl,(%eax)
c0105c31:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105c34:	0f b6 00             	movzbl (%eax),%eax
c0105c37:	84 c0                	test   %al,%al
c0105c39:	74 03                	je     c0105c3e <strncpy+0x26>
            src ++;
c0105c3b:	ff 45 0c             	incl   0xc(%ebp)
        }
        p ++, len --;
c0105c3e:	ff 45 fc             	incl   -0x4(%ebp)
c0105c41:	ff 4d 10             	decl   0x10(%ebp)
    while (len > 0) {
c0105c44:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105c48:	75 dc                	jne    c0105c26 <strncpy+0xe>
    }
    return dst;
c0105c4a:	8b 45 08             	mov    0x8(%ebp),%eax
}
c0105c4d:	89 ec                	mov    %ebp,%esp
c0105c4f:	5d                   	pop    %ebp
c0105c50:	c3                   	ret    

c0105c51 <strcmp>:
 * - A value greater than zero indicates that the first character that does
 *   not match has a greater value in @s1 than in @s2;
 * - And a value less than zero indicates the opposite.
 * */
int
strcmp(const char *s1, const char *s2) {
c0105c51:	55                   	push   %ebp
c0105c52:	89 e5                	mov    %esp,%ebp
c0105c54:	57                   	push   %edi
c0105c55:	56                   	push   %esi
c0105c56:	83 ec 20             	sub    $0x20,%esp
c0105c59:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c5c:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105c5f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105c62:	89 45 f0             	mov    %eax,-0x10(%ebp)
    asm volatile (
c0105c65:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0105c68:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105c6b:	89 d1                	mov    %edx,%ecx
c0105c6d:	89 c2                	mov    %eax,%edx
c0105c6f:	89 ce                	mov    %ecx,%esi
c0105c71:	89 d7                	mov    %edx,%edi
c0105c73:	ac                   	lods   %ds:(%esi),%al
c0105c74:	ae                   	scas   %es:(%edi),%al
c0105c75:	75 08                	jne    c0105c7f <strcmp+0x2e>
c0105c77:	84 c0                	test   %al,%al
c0105c79:	75 f8                	jne    c0105c73 <strcmp+0x22>
c0105c7b:	31 c0                	xor    %eax,%eax
c0105c7d:	eb 04                	jmp    c0105c83 <strcmp+0x32>
c0105c7f:	19 c0                	sbb    %eax,%eax
c0105c81:	0c 01                	or     $0x1,%al
c0105c83:	89 fa                	mov    %edi,%edx
c0105c85:	89 f1                	mov    %esi,%ecx
c0105c87:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105c8a:	89 4d e8             	mov    %ecx,-0x18(%ebp)
c0105c8d:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    return ret;
c0105c90:	8b 45 ec             	mov    -0x14(%ebp),%eax
    while (*s1 != '\0' && *s1 == *s2) {
        s1 ++, s2 ++;
    }
    return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
c0105c93:	83 c4 20             	add    $0x20,%esp
c0105c96:	5e                   	pop    %esi
c0105c97:	5f                   	pop    %edi
c0105c98:	5d                   	pop    %ebp
c0105c99:	c3                   	ret    

c0105c9a <strncmp>:
 * they are equal to each other, it continues with the following pairs until
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
c0105c9a:	55                   	push   %ebp
c0105c9b:	89 e5                	mov    %esp,%ebp
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c0105c9d:	eb 09                	jmp    c0105ca8 <strncmp+0xe>
        n --, s1 ++, s2 ++;
c0105c9f:	ff 4d 10             	decl   0x10(%ebp)
c0105ca2:	ff 45 08             	incl   0x8(%ebp)
c0105ca5:	ff 45 0c             	incl   0xc(%ebp)
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c0105ca8:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105cac:	74 1a                	je     c0105cc8 <strncmp+0x2e>
c0105cae:	8b 45 08             	mov    0x8(%ebp),%eax
c0105cb1:	0f b6 00             	movzbl (%eax),%eax
c0105cb4:	84 c0                	test   %al,%al
c0105cb6:	74 10                	je     c0105cc8 <strncmp+0x2e>
c0105cb8:	8b 45 08             	mov    0x8(%ebp),%eax
c0105cbb:	0f b6 10             	movzbl (%eax),%edx
c0105cbe:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105cc1:	0f b6 00             	movzbl (%eax),%eax
c0105cc4:	38 c2                	cmp    %al,%dl
c0105cc6:	74 d7                	je     c0105c9f <strncmp+0x5>
    }
    return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
c0105cc8:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105ccc:	74 18                	je     c0105ce6 <strncmp+0x4c>
c0105cce:	8b 45 08             	mov    0x8(%ebp),%eax
c0105cd1:	0f b6 00             	movzbl (%eax),%eax
c0105cd4:	0f b6 d0             	movzbl %al,%edx
c0105cd7:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105cda:	0f b6 00             	movzbl (%eax),%eax
c0105cdd:	0f b6 c8             	movzbl %al,%ecx
c0105ce0:	89 d0                	mov    %edx,%eax
c0105ce2:	29 c8                	sub    %ecx,%eax
c0105ce4:	eb 05                	jmp    c0105ceb <strncmp+0x51>
c0105ce6:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0105ceb:	5d                   	pop    %ebp
c0105cec:	c3                   	ret    

c0105ced <strchr>:
 *
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
c0105ced:	55                   	push   %ebp
c0105cee:	89 e5                	mov    %esp,%ebp
c0105cf0:	83 ec 04             	sub    $0x4,%esp
c0105cf3:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105cf6:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
c0105cf9:	eb 13                	jmp    c0105d0e <strchr+0x21>
        if (*s == c) {
c0105cfb:	8b 45 08             	mov    0x8(%ebp),%eax
c0105cfe:	0f b6 00             	movzbl (%eax),%eax
c0105d01:	38 45 fc             	cmp    %al,-0x4(%ebp)
c0105d04:	75 05                	jne    c0105d0b <strchr+0x1e>
            return (char *)s;
c0105d06:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d09:	eb 12                	jmp    c0105d1d <strchr+0x30>
        }
        s ++;
c0105d0b:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
c0105d0e:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d11:	0f b6 00             	movzbl (%eax),%eax
c0105d14:	84 c0                	test   %al,%al
c0105d16:	75 e3                	jne    c0105cfb <strchr+0xe>
    }
    return NULL;
c0105d18:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0105d1d:	89 ec                	mov    %ebp,%esp
c0105d1f:	5d                   	pop    %ebp
c0105d20:	c3                   	ret    

c0105d21 <strfind>:
 * The strfind() function is like strchr() except that if @c is
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
c0105d21:	55                   	push   %ebp
c0105d22:	89 e5                	mov    %esp,%ebp
c0105d24:	83 ec 04             	sub    $0x4,%esp
c0105d27:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105d2a:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
c0105d2d:	eb 0e                	jmp    c0105d3d <strfind+0x1c>
        if (*s == c) {
c0105d2f:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d32:	0f b6 00             	movzbl (%eax),%eax
c0105d35:	38 45 fc             	cmp    %al,-0x4(%ebp)
c0105d38:	74 0f                	je     c0105d49 <strfind+0x28>
            break;
        }
        s ++;
c0105d3a:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
c0105d3d:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d40:	0f b6 00             	movzbl (%eax),%eax
c0105d43:	84 c0                	test   %al,%al
c0105d45:	75 e8                	jne    c0105d2f <strfind+0xe>
c0105d47:	eb 01                	jmp    c0105d4a <strfind+0x29>
            break;
c0105d49:	90                   	nop
    }
    return (char *)s;
c0105d4a:	8b 45 08             	mov    0x8(%ebp),%eax
}
c0105d4d:	89 ec                	mov    %ebp,%esp
c0105d4f:	5d                   	pop    %ebp
c0105d50:	c3                   	ret    

c0105d51 <strtol>:
 * an optional "0x" or "0X" prefix.
 *
 * The strtol() function returns the converted integral number as a long int value.
 * */
long
strtol(const char *s, char **endptr, int base) {
c0105d51:	55                   	push   %ebp
c0105d52:	89 e5                	mov    %esp,%ebp
c0105d54:	83 ec 10             	sub    $0x10,%esp
    int neg = 0;
c0105d57:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    long val = 0;
c0105d5e:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
c0105d65:	eb 03                	jmp    c0105d6a <strtol+0x19>
        s ++;
c0105d67:	ff 45 08             	incl   0x8(%ebp)
    while (*s == ' ' || *s == '\t') {
c0105d6a:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d6d:	0f b6 00             	movzbl (%eax),%eax
c0105d70:	3c 20                	cmp    $0x20,%al
c0105d72:	74 f3                	je     c0105d67 <strtol+0x16>
c0105d74:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d77:	0f b6 00             	movzbl (%eax),%eax
c0105d7a:	3c 09                	cmp    $0x9,%al
c0105d7c:	74 e9                	je     c0105d67 <strtol+0x16>
    }

    // plus/minus sign
    if (*s == '+') {
c0105d7e:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d81:	0f b6 00             	movzbl (%eax),%eax
c0105d84:	3c 2b                	cmp    $0x2b,%al
c0105d86:	75 05                	jne    c0105d8d <strtol+0x3c>
        s ++;
c0105d88:	ff 45 08             	incl   0x8(%ebp)
c0105d8b:	eb 14                	jmp    c0105da1 <strtol+0x50>
    }
    else if (*s == '-') {
c0105d8d:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d90:	0f b6 00             	movzbl (%eax),%eax
c0105d93:	3c 2d                	cmp    $0x2d,%al
c0105d95:	75 0a                	jne    c0105da1 <strtol+0x50>
        s ++, neg = 1;
c0105d97:	ff 45 08             	incl   0x8(%ebp)
c0105d9a:	c7 45 fc 01 00 00 00 	movl   $0x1,-0x4(%ebp)
    }

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
c0105da1:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105da5:	74 06                	je     c0105dad <strtol+0x5c>
c0105da7:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
c0105dab:	75 22                	jne    c0105dcf <strtol+0x7e>
c0105dad:	8b 45 08             	mov    0x8(%ebp),%eax
c0105db0:	0f b6 00             	movzbl (%eax),%eax
c0105db3:	3c 30                	cmp    $0x30,%al
c0105db5:	75 18                	jne    c0105dcf <strtol+0x7e>
c0105db7:	8b 45 08             	mov    0x8(%ebp),%eax
c0105dba:	40                   	inc    %eax
c0105dbb:	0f b6 00             	movzbl (%eax),%eax
c0105dbe:	3c 78                	cmp    $0x78,%al
c0105dc0:	75 0d                	jne    c0105dcf <strtol+0x7e>
        s += 2, base = 16;
c0105dc2:	83 45 08 02          	addl   $0x2,0x8(%ebp)
c0105dc6:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
c0105dcd:	eb 29                	jmp    c0105df8 <strtol+0xa7>
    }
    else if (base == 0 && s[0] == '0') {
c0105dcf:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105dd3:	75 16                	jne    c0105deb <strtol+0x9a>
c0105dd5:	8b 45 08             	mov    0x8(%ebp),%eax
c0105dd8:	0f b6 00             	movzbl (%eax),%eax
c0105ddb:	3c 30                	cmp    $0x30,%al
c0105ddd:	75 0c                	jne    c0105deb <strtol+0x9a>
        s ++, base = 8;
c0105ddf:	ff 45 08             	incl   0x8(%ebp)
c0105de2:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)
c0105de9:	eb 0d                	jmp    c0105df8 <strtol+0xa7>
    }
    else if (base == 0) {
c0105deb:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105def:	75 07                	jne    c0105df8 <strtol+0xa7>
        base = 10;
c0105df1:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

    // digits
    while (1) {
        int dig;

        if (*s >= '0' && *s <= '9') {
c0105df8:	8b 45 08             	mov    0x8(%ebp),%eax
c0105dfb:	0f b6 00             	movzbl (%eax),%eax
c0105dfe:	3c 2f                	cmp    $0x2f,%al
c0105e00:	7e 1b                	jle    c0105e1d <strtol+0xcc>
c0105e02:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e05:	0f b6 00             	movzbl (%eax),%eax
c0105e08:	3c 39                	cmp    $0x39,%al
c0105e0a:	7f 11                	jg     c0105e1d <strtol+0xcc>
            dig = *s - '0';
c0105e0c:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e0f:	0f b6 00             	movzbl (%eax),%eax
c0105e12:	0f be c0             	movsbl %al,%eax
c0105e15:	83 e8 30             	sub    $0x30,%eax
c0105e18:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105e1b:	eb 48                	jmp    c0105e65 <strtol+0x114>
        }
        else if (*s >= 'a' && *s <= 'z') {
c0105e1d:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e20:	0f b6 00             	movzbl (%eax),%eax
c0105e23:	3c 60                	cmp    $0x60,%al
c0105e25:	7e 1b                	jle    c0105e42 <strtol+0xf1>
c0105e27:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e2a:	0f b6 00             	movzbl (%eax),%eax
c0105e2d:	3c 7a                	cmp    $0x7a,%al
c0105e2f:	7f 11                	jg     c0105e42 <strtol+0xf1>
            dig = *s - 'a' + 10;
c0105e31:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e34:	0f b6 00             	movzbl (%eax),%eax
c0105e37:	0f be c0             	movsbl %al,%eax
c0105e3a:	83 e8 57             	sub    $0x57,%eax
c0105e3d:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105e40:	eb 23                	jmp    c0105e65 <strtol+0x114>
        }
        else if (*s >= 'A' && *s <= 'Z') {
c0105e42:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e45:	0f b6 00             	movzbl (%eax),%eax
c0105e48:	3c 40                	cmp    $0x40,%al
c0105e4a:	7e 3b                	jle    c0105e87 <strtol+0x136>
c0105e4c:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e4f:	0f b6 00             	movzbl (%eax),%eax
c0105e52:	3c 5a                	cmp    $0x5a,%al
c0105e54:	7f 31                	jg     c0105e87 <strtol+0x136>
            dig = *s - 'A' + 10;
c0105e56:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e59:	0f b6 00             	movzbl (%eax),%eax
c0105e5c:	0f be c0             	movsbl %al,%eax
c0105e5f:	83 e8 37             	sub    $0x37,%eax
c0105e62:	89 45 f4             	mov    %eax,-0xc(%ebp)
        }
        else {
            break;
        }
        if (dig >= base) {
c0105e65:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105e68:	3b 45 10             	cmp    0x10(%ebp),%eax
c0105e6b:	7d 19                	jge    c0105e86 <strtol+0x135>
            break;
        }
        s ++, val = (val * base) + dig;
c0105e6d:	ff 45 08             	incl   0x8(%ebp)
c0105e70:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105e73:	0f af 45 10          	imul   0x10(%ebp),%eax
c0105e77:	89 c2                	mov    %eax,%edx
c0105e79:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105e7c:	01 d0                	add    %edx,%eax
c0105e7e:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (1) {
c0105e81:	e9 72 ff ff ff       	jmp    c0105df8 <strtol+0xa7>
            break;
c0105e86:	90                   	nop
        // we don't properly detect overflow!
    }

    if (endptr) {
c0105e87:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0105e8b:	74 08                	je     c0105e95 <strtol+0x144>
        *endptr = (char *) s;
c0105e8d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105e90:	8b 55 08             	mov    0x8(%ebp),%edx
c0105e93:	89 10                	mov    %edx,(%eax)
    }
    return (neg ? -val : val);
c0105e95:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
c0105e99:	74 07                	je     c0105ea2 <strtol+0x151>
c0105e9b:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105e9e:	f7 d8                	neg    %eax
c0105ea0:	eb 03                	jmp    c0105ea5 <strtol+0x154>
c0105ea2:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
c0105ea5:	89 ec                	mov    %ebp,%esp
c0105ea7:	5d                   	pop    %ebp
c0105ea8:	c3                   	ret    

c0105ea9 <memset>:
 * @n:      number of bytes to be set to the value
 *
 * The memset() function returns @s.
 * */
void *
memset(void *s, char c, size_t n) {
c0105ea9:	55                   	push   %ebp
c0105eaa:	89 e5                	mov    %esp,%ebp
c0105eac:	83 ec 28             	sub    $0x28,%esp
c0105eaf:	89 7d fc             	mov    %edi,-0x4(%ebp)
c0105eb2:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105eb5:	88 45 d8             	mov    %al,-0x28(%ebp)
#ifdef __HAVE_ARCH_MEMSET
    return __memset(s, c, n);
c0105eb8:	0f be 55 d8          	movsbl -0x28(%ebp),%edx
c0105ebc:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ebf:	89 45 f8             	mov    %eax,-0x8(%ebp)
c0105ec2:	88 55 f7             	mov    %dl,-0x9(%ebp)
c0105ec5:	8b 45 10             	mov    0x10(%ebp),%eax
c0105ec8:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
    int d0, d1;
    asm volatile (
c0105ecb:	8b 4d f0             	mov    -0x10(%ebp),%ecx
c0105ece:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
c0105ed2:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0105ed5:	89 d7                	mov    %edx,%edi
c0105ed7:	f3 aa                	rep stos %al,%es:(%edi)
c0105ed9:	89 fa                	mov    %edi,%edx
c0105edb:	89 4d ec             	mov    %ecx,-0x14(%ebp)
c0105ede:	89 55 e8             	mov    %edx,-0x18(%ebp)
        "rep; stosb;"
        : "=&c" (d0), "=&D" (d1)
        : "0" (n), "a" (c), "1" (s)
        : "memory");
    return s;
c0105ee1:	8b 45 f8             	mov    -0x8(%ebp),%eax
    while (n -- > 0) {
        *p ++ = c;
    }
    return s;
#endif /* __HAVE_ARCH_MEMSET */
}
c0105ee4:	8b 7d fc             	mov    -0x4(%ebp),%edi
c0105ee7:	89 ec                	mov    %ebp,%esp
c0105ee9:	5d                   	pop    %ebp
c0105eea:	c3                   	ret    

c0105eeb <memmove>:
 * @n:      number of bytes to copy
 *
 * The memmove() function returns @dst.
 * */
void *
memmove(void *dst, const void *src, size_t n) {
c0105eeb:	55                   	push   %ebp
c0105eec:	89 e5                	mov    %esp,%ebp
c0105eee:	57                   	push   %edi
c0105eef:	56                   	push   %esi
c0105ef0:	53                   	push   %ebx
c0105ef1:	83 ec 30             	sub    $0x30,%esp
c0105ef4:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ef7:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105efa:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105efd:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105f00:	8b 45 10             	mov    0x10(%ebp),%eax
c0105f03:	89 45 e8             	mov    %eax,-0x18(%ebp)

#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
c0105f06:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105f09:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0105f0c:	73 42                	jae    c0105f50 <memmove+0x65>
c0105f0e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105f11:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105f14:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105f17:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0105f1a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105f1d:	89 45 dc             	mov    %eax,-0x24(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0105f20:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105f23:	c1 e8 02             	shr    $0x2,%eax
c0105f26:	89 c1                	mov    %eax,%ecx
    asm volatile (
c0105f28:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0105f2b:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105f2e:	89 d7                	mov    %edx,%edi
c0105f30:	89 c6                	mov    %eax,%esi
c0105f32:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0105f34:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c0105f37:	83 e1 03             	and    $0x3,%ecx
c0105f3a:	74 02                	je     c0105f3e <memmove+0x53>
c0105f3c:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0105f3e:	89 f0                	mov    %esi,%eax
c0105f40:	89 fa                	mov    %edi,%edx
c0105f42:	89 4d d8             	mov    %ecx,-0x28(%ebp)
c0105f45:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0105f48:	89 45 d0             	mov    %eax,-0x30(%ebp)
        : "memory");
    return dst;
c0105f4b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
        return __memcpy(dst, src, n);
c0105f4e:	eb 36                	jmp    c0105f86 <memmove+0x9b>
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
c0105f50:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105f53:	8d 50 ff             	lea    -0x1(%eax),%edx
c0105f56:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105f59:	01 c2                	add    %eax,%edx
c0105f5b:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105f5e:	8d 48 ff             	lea    -0x1(%eax),%ecx
c0105f61:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105f64:	8d 1c 01             	lea    (%ecx,%eax,1),%ebx
    asm volatile (
c0105f67:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105f6a:	89 c1                	mov    %eax,%ecx
c0105f6c:	89 d8                	mov    %ebx,%eax
c0105f6e:	89 d6                	mov    %edx,%esi
c0105f70:	89 c7                	mov    %eax,%edi
c0105f72:	fd                   	std    
c0105f73:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0105f75:	fc                   	cld    
c0105f76:	89 f8                	mov    %edi,%eax
c0105f78:	89 f2                	mov    %esi,%edx
c0105f7a:	89 4d cc             	mov    %ecx,-0x34(%ebp)
c0105f7d:	89 55 c8             	mov    %edx,-0x38(%ebp)
c0105f80:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return dst;
c0105f83:	8b 45 f0             	mov    -0x10(%ebp),%eax
            *d ++ = *s ++;
        }
    }
    return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
c0105f86:	83 c4 30             	add    $0x30,%esp
c0105f89:	5b                   	pop    %ebx
c0105f8a:	5e                   	pop    %esi
c0105f8b:	5f                   	pop    %edi
c0105f8c:	5d                   	pop    %ebp
c0105f8d:	c3                   	ret    

c0105f8e <memcpy>:
 * it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
 * by both @src and @dst, should be at least @n bytes, and should not overlap
 * (for overlapping memory area, memmove is a safer approach).
 * */
void *
memcpy(void *dst, const void *src, size_t n) {
c0105f8e:	55                   	push   %ebp
c0105f8f:	89 e5                	mov    %esp,%ebp
c0105f91:	57                   	push   %edi
c0105f92:	56                   	push   %esi
c0105f93:	83 ec 20             	sub    $0x20,%esp
c0105f96:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f99:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105f9c:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105f9f:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105fa2:	8b 45 10             	mov    0x10(%ebp),%eax
c0105fa5:	89 45 ec             	mov    %eax,-0x14(%ebp)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0105fa8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105fab:	c1 e8 02             	shr    $0x2,%eax
c0105fae:	89 c1                	mov    %eax,%ecx
    asm volatile (
c0105fb0:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0105fb3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105fb6:	89 d7                	mov    %edx,%edi
c0105fb8:	89 c6                	mov    %eax,%esi
c0105fba:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0105fbc:	8b 4d ec             	mov    -0x14(%ebp),%ecx
c0105fbf:	83 e1 03             	and    $0x3,%ecx
c0105fc2:	74 02                	je     c0105fc6 <memcpy+0x38>
c0105fc4:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0105fc6:	89 f0                	mov    %esi,%eax
c0105fc8:	89 fa                	mov    %edi,%edx
c0105fca:	89 4d e8             	mov    %ecx,-0x18(%ebp)
c0105fcd:	89 55 e4             	mov    %edx,-0x1c(%ebp)
c0105fd0:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return dst;
c0105fd3:	8b 45 f4             	mov    -0xc(%ebp),%eax
    while (n -- > 0) {
        *d ++ = *s ++;
    }
    return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
c0105fd6:	83 c4 20             	add    $0x20,%esp
c0105fd9:	5e                   	pop    %esi
c0105fda:	5f                   	pop    %edi
c0105fdb:	5d                   	pop    %ebp
c0105fdc:	c3                   	ret    

c0105fdd <memcmp>:
 *   match in both memory blocks has a greater value in @v1 than in @v2
 *   as if evaluated as unsigned char values;
 * - And a value less than zero indicates the opposite.
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
c0105fdd:	55                   	push   %ebp
c0105fde:	89 e5                	mov    %esp,%ebp
c0105fe0:	83 ec 10             	sub    $0x10,%esp
    const char *s1 = (const char *)v1;
c0105fe3:	8b 45 08             	mov    0x8(%ebp),%eax
c0105fe6:	89 45 fc             	mov    %eax,-0x4(%ebp)
    const char *s2 = (const char *)v2;
c0105fe9:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105fec:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (n -- > 0) {
c0105fef:	eb 2e                	jmp    c010601f <memcmp+0x42>
        if (*s1 != *s2) {
c0105ff1:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105ff4:	0f b6 10             	movzbl (%eax),%edx
c0105ff7:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105ffa:	0f b6 00             	movzbl (%eax),%eax
c0105ffd:	38 c2                	cmp    %al,%dl
c0105fff:	74 18                	je     c0106019 <memcmp+0x3c>
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
c0106001:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0106004:	0f b6 00             	movzbl (%eax),%eax
c0106007:	0f b6 d0             	movzbl %al,%edx
c010600a:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010600d:	0f b6 00             	movzbl (%eax),%eax
c0106010:	0f b6 c8             	movzbl %al,%ecx
c0106013:	89 d0                	mov    %edx,%eax
c0106015:	29 c8                	sub    %ecx,%eax
c0106017:	eb 18                	jmp    c0106031 <memcmp+0x54>
        }
        s1 ++, s2 ++;
c0106019:	ff 45 fc             	incl   -0x4(%ebp)
c010601c:	ff 45 f8             	incl   -0x8(%ebp)
    while (n -- > 0) {
c010601f:	8b 45 10             	mov    0x10(%ebp),%eax
c0106022:	8d 50 ff             	lea    -0x1(%eax),%edx
c0106025:	89 55 10             	mov    %edx,0x10(%ebp)
c0106028:	85 c0                	test   %eax,%eax
c010602a:	75 c5                	jne    c0105ff1 <memcmp+0x14>
    }
    return 0;
c010602c:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0106031:	89 ec                	mov    %ebp,%esp
c0106033:	5d                   	pop    %ebp
c0106034:	c3                   	ret    
